Problems with Android Manifests.

Hello,

I am having these errors while building Android game:

Error: [Temp/StagingArea/AndroidManifest-main.xml:8, /Users/haraldsveiss/Desktop/The Ascension (Android)/Temp/StagingArea/android-libraries/ChartboostSDK/AndroidManifest.xml:11] Trying to merge incompatible /manifest/application/meta-data[@name=com.google.android.gms.version] element:

UnityEditor.HostView:OnGUI()

Error: [Temp/StagingArea/AndroidManifest-main.xml:8, /Users/haraldsveiss/Desktop/The Ascension (Android)/Temp/StagingArea/android-libraries/GoogleMobileAdsPlugin/AndroidManifest.xml:10] Trying to merge incompatible /manifest/application/meta-data[@name=com.google.android.gms.version] element:

UnityEditor.HostView:OnGUI()

Error: [Temp/StagingArea/AndroidManifest-main.xml:8, /Users/haraldsveiss/Desktop/The Ascension (Android)/Temp/StagingArea/android-libraries/google-play-services_lib/AndroidManifest.xml:5] Trying to merge incompatible /manifest/application/meta-data[@name=com.google.android.gms.version] element:

UnityEditor.HostView:OnGUI()

CommandInvokationFailure: Unable to merge android manifests. See the Console for more details.
/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/bin/java -Xmx2048M -Dcom.android.sdkmanager.toolsdir=“/Users/haraldsveiss/Downloads/android-sdk-macosx-2/tools” -Dfile.encoding=UTF8 -jar “/Applications/Unity 5.1/Unity.app/Contents/BuildTargetTools/AndroidPlayer/sdktools.jar” -

stderr[
Error: [Temp/StagingArea/AndroidManifest-main.xml:8, /Users/haraldsveiss/Desktop/The Ascension (Android)/Temp/StagingArea/android-libraries/ChartboostSDK/AndroidManifest.xml:11] Trying to merge incompatible /manifest/application/meta-data[@name=com.google.android.gms.version] element:

Error: [Temp/StagingArea/AndroidManifest-main.xml:8, /Users/haraldsveiss/Desktop/The Ascension (Android)/Temp/StagingArea/android-libraries/GoogleMobileAdsPlugin/AndroidManifest.xml:10] Trying to merge incompatible /manifest/application/meta-data[@name=com.google.android.gms.version] element:

Error: [Temp/StagingArea/AndroidManifest-main.xml:8, /Users/haraldsveiss/Desktop/The Ascension (Android)/Temp/StagingArea/android-libraries/google-play-services_lib/AndroidManifest.xml:5] Trying to merge incompatible /manifest/application/meta-data[@name=com.google.android.gms.version] element:

]
stdout[
[Temp/StagingArea/AndroidManifest-main.xml:41, /Users/haraldsveiss/Desktop/The Ascension (Android)/Temp/StagingArea/android-libraries/GoogleMobileAdsPlugin/AndroidManifest.xml:12] Skipping identical /manifest/application/activity[@name=com.google.android.gms.ads.AdActivity] element.
]
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.AndroidSDKTools.RunCommandInternal (System.String javaExe, System.String sdkToolsDir, System.String sdkToolCommand, Int32 memoryMB, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.AndroidSDKTools.RunCommandSafe (System.String javaExe, System.String sdkToolsDir, System.String sdkToolCommand, Int32 memoryMB, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)

Error building Player: CommandInvokationFailure: Unable to merge android manifests. See the Console for more details.
/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/bin/java -Xmx2048M -Dcom.android.sdkmanager.toolsdir=“/Users/haraldsveiss/Downloads/android-sdk-macosx-2/tools” -Dfile.encoding=UTF8 -jar “/Applications/Unity 5.1/Unity.app/Contents/BuildTargetTools/AndroidPlayer/sdktools.jar” -

stderr[
Error: [Temp/StagingArea/AndroidManifest-main.xml:8, /Users/haraldsveiss/Desktop/The Ascension (Android)/Temp/StagingArea/android-libraries/ChartboostSDK/AndroidManifest.xml:11] Trying to merge incompatible /manifest/application/meta-data[@name=com.google.android.gms.version] element:

Error: [Temp/StagingArea/AndroidManifest-main.xml:8, /Users/haraldsveiss/Desktop/The Ascension (Android)/Temp/StagingArea/android-libraries/GoogleMobileAdsPlugin/AndroidManifest.xml:10] Trying to merge incompatible /manifest/application/meta-data[@name=com.google.android.gms.version] element:

Error: [Temp/StagingArea/AndroidManifest-main.xml:8, /Users/haraldsveiss/Desktop/The Ascension (Android)/Temp/StagingArea/android-libraries/google-play-services_lib/AndroidManifest.xml:5] Trying to merge incompatible /manifest/application/meta-data[@name=com.google.android.gms.version] element:

]
stdout[
[Temp/StagingArea/AndroidManifest-main.xml:41, /Users/haraldsveiss/Desktop/The Ascension (Android)/Temp/StagingArea/android-libraries/GoogleMobileAdsPlugin/AndroidManifest.xml:12] Skipping identical /manifest/application/activity[@name=com.google.android.gms.ads.AdActivity] element.

I am stuck, can’t figure this out. Please help me to sort this out!

Thank you for taking the time and reading this.

Best,
Haralds

Ah yeah I hate when this happens. Try to see if you have 2 similar libraries in your projects (jar, aar, etc.).
It could be a duplicated google-play-service library, or a duplicated support-v4 something library (or else I guess). Try to find the duplicates in the editor asset view and delete 1 of the 2. Try to keep the one which seems the most recent, or for example if you are using google-play-service plugin for Unity, use their library instead of the other one.

Good luck!

The line below is the important part. Notice how it says incompatible gms version. Gms is Google mobile services/play services is part of gms.

You probably have two manifests that define two different gms or play services version. Or the manifest defines an earlier gms version then the one you actually have in your plugin directory, vice versa. There will be a tag in the manifest that says gms_version or something like that.

Go through the manifests and make sure they all have the same gms version defined. Sometimes the manifest will point to a variable that contains the gms version.

Trying to merge incompatible /manifest/application/meta-data[@name=com.google.android.gms.version]