Can't build with OneSignal + Admob - Unity 2018.4.2

429 views
Skip to first unread message

Mubshar Rehman

unread,
Jun 21, 2019, 2:43:45 AM6/21/19
to Google Mobile Ads SDK Developers

one.PNG



Description:

build failed using the latest version of  Admob and one signal.

Execution failed for task ':processReleaseManifest'.

Manifest merger failed : Attribute application@appComponentFactory value=(androidx.core.app.CoreComponentFactory) from [:androidx.core.core-1.0.0:] AndroidManifest.xml:22:18-86
is also present at [:com.android.support.support-compat-28.0.0:] AndroidManifest.xml:22:18-91 value=(android.support.v4.app.CoreComponentFactory).
Suggestion: add 'tools:replace="android:appComponentFactory"' to element at AndroidManifest.xml:5:3-19:17 to override.

Environment

Steps to Reproduce Issue:

  1. Import the latest Admob.unitypackage and OneSignalSDK.unitypackage into the project
  2. Resolve Dependencies
  3. Attempt to build

Mobile Ads SDK Forum Advisor Prod

unread,
Jun 21, 2019, 5:09:37 AM6/21/19
to me.mu...@gmail.com, google-adm...@googlegroups.com
Hi Mubshar,

Thank you for reaching out to us. Kindly note that we can only promise full support for the AdMob SDK, and cannot assure the same for third-party products such as the OneSignal SDK. That said, you may see our analysis below.

The reason that the Unity build process was failing was because the project contained both AndroidX and Support Libraries, after dependencies were resolved. This caused classes to be erroneously declared twice (one in each of the above-mentioned libraries). You may try deleting all the Support Libraries after the Play Services Resolver has finished resolving dependencies, then build/export the project afterwards (please see attached screenshot); I was able to both build and export the project after attempting the above procedure.

Let me know if this works for you.

Regards,
Ziv Yves Sanchez
Mobile Ads SDK Team

ref:_00D1U1174p._5001UCYkVo:ref
Screenshot from 2019-06-21 17-02-27.png
Screenshot from 2019-06-21 16-38-08.png

Alex

unread,
Jun 21, 2019, 3:33:54 PM6/21/19
to Google Mobile Ads SDK Developers
Hi guys,

The solution from Ziv Yves Sanchez works for me. But only if I'm trying to build in manual mode.
If I'm trying to make automated build, it gives me such error:

FileNotFoundException: Assets\Plugins\Android\com.android.support.support-compat-27.1.1.aar does not exist
System.IO.File.Copy (System.String sourceFileName, System.String destFileName, Boolean overwrite) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/File.cs:107)
UnityEditor.FileUtil.UnityFileCopy (System.String from, System.String to, Boolean overwrite) (at C:/buildslave/unity/build/Editor/Mono/FileUtil.cs:210)
UnityEditor.Android.PostProcessor.Tasks.NativePlugins.ProcessPlugin (UnityEditor.Android.PostProcessor.PostProcessorContext context, System.String pluginPath, System.String pluginTargetCPU)
UnityEditor.Android.PostProcessor.Tasks.NativePlugins.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context)
UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report)
UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties)
UnityEditor.PostprocessBuildPlayer.Postprocess (BuildTargetGroup targetGroup, BuildTarget target, System.String installPath, System.String companyName, System.String productName, Int32 width, Int32 height, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:287)
UnityEditor.BuildPipeline:BuildPlayer(BuildPlayerOptions)
BuildAndroidMultiLang:BuildForAndroid(String) (at Assets/Scripts/Editor/BuildAndroidMultiLang.cs:445)
BuildAndroidMultiLang:ChangeIdtoBr() (at Assets/Scripts/Editor/BuildAndroidMultiLang.cs:130)

My automated build workflow:
1. Synchronous code for ResolveAndroidDependencies.
2. Code for removing "android support .aar files".
3. Code for building APK.

Logs show me, that everything is done as expected, but it throws error brfore the end of build pipeline. I think something still trying to add .aar files to the final build. Can you help me to fix the issue?

Alex

unread,
Jun 23, 2019, 10:42:43 AM6/23/19
to Google Mobile Ads SDK Developers
Nevermind, I fixed the issue.
Just needed to add AssetDatabase.Refresh(); after delete support files logic. 
Reply all
Reply to author
Forward
0 new messages