Reputation: 4253
I was working with google play services without any problem. after I add Admob, I start seeing this issue. I don't know what's the problem. I tried to search about it here, but I couldn't find any working solution. Can you help please?
Error building Player: CommandInvokationFailure: Unable to merge android manifests. See the Console for more details.
C:/Program Files/Java/jdk1.8.0_91\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="C:/Users/Wasim-PC/AppData/Local/Android/sdk\tools" -Dfile.encoding=UTF8 -jar "C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -
stderr[
Error: [Temp\StagingArea\AndroidManifest-main.xml:22, C:\Users\Wasim-PC\Documents\Fly With The Air\Temp\StagingArea\android-libraries\MainLibProj\AndroidManifest.xml:13] Trying to merge incompatible /manifest/application/meta-data[@name=com.google.android.gms.version] element:
<meta-data
@android:name="com.google.android.gms.version"
-- @android:value="8115000">
<meta-data
@android:name="com.google.android.gms.version"
++ @android:value="@integer/google_play_services_version">
Error: [Temp\StagingArea\AndroidManifest-main.xml:22, C:\Users\Wasim-PC\Documents\Fly With The Air\Temp\StagingArea\android-libraries\play-services-basement-9.2.1\AndroidManifest.xml:5] Trying to merge incompatible /manifest/application/meta-data[@name=com.google.android.gms.version] element:
<meta-data
@android:name="com.google.android.gms.version"
-- @android:value="8115000">
<meta-data
@android:name="com.google.android.gms.version"
++ @android:value="@integer/google_play_services_version">
]
stdout[
]
Upvotes: 1
Views: 4164
Reputation: 13
I had same issue that's because you're using GamePlayServices, it also contains Google Ad Files.
Download latest version of Google Mobile Ads plugin for unity from this link - https://github.com/googleads/googleads-mobile-unity
(Note - this folder does not have a .unitypackage file, so you need to copy assets folder from source\plugin\ and paste it to your project replace all files if asked by copier. And if you need to import sample scene, copy assets from samples\HelloWorld\ and paste it in your project.)
Upvotes: 0
Reputation: 125255
Here is the problem:
<meta-data android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
is defined in the AndroidManifest.xml
from the Assets\Plugins\Android\MainLibProj
directory.
then again as
<meta-data android:name="com.google.android.gms.version"
android:value="8115000" />
in the AndroidManifest.xml
from the Assets\Plugins\Android
directory.
As you can see, they both contain different values. This is why Unity is confused on which one to use.
Solution:
Keep the android:value="8115000"
value and remove the android:value="@integer/google_play_services_version"
value.
To do this, simply go to Assets\Plugins\Android\MainLibProj
, Open AndroidManifest.xml
file, remove
<meta-data android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
and save. Build your project again and your problem should be gone.
Upvotes: 1