Unable to merge android manifest error

Hi,
I have two plugins in project and when I try to build, it throws this error…

Error: [Temp\StagingArea\AndroidManifest-main.xml:9, E:\BikeTrafficRacer3\BikeTrafficRacer\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:
<meta-data
@android:name=“com.google.android.gms.version”
@android:value=“6171000”>
<meta-data
@android:name=“com.google.android.gms.version”
++ @android:value=" @Integer /google_play_services_version">
]
stdout[

]
I have tried solution given in following link but it does not work.

Anyone Please?

I’m getting the same error.
Ever figure it out??

very late reply… anyhow…
There are more android manifest files due to more plugins. When taking a build unity merges them all.
conflict will happen if the files have different values

the case above have the two different values
@android:value=“6171000”>
@android:value=“@@Integer/google_play_services_version”>

  1. which ever is correct value, add it to both the android manifest files.
    or
  2. try removing the value from one file
1 Like

YES THANK YOU

I know this topic is old but I want to put my solution here.

I was using two plugins, unity ads and a native android plugin.
When importing the native android plugin a few of the names where the same as in the ads folder.

These files overwrote the ones in the ads folder and made i stop working.

Solution: Reimport asset that may have been overwritten.

I just went to the project folder, searched for all AndroidManifest files and edited them all to have the same min and targeted versions. Just didnt match :slight_smile:

1 Like

I STARTED A NEW PROJECT ,ADDED THE CARDBOARD VR MAIN CAMERA AND A SIMPLE CUBE AND TRIED TO BUILD PROJECT IT SHOW ERROR (unable to merge android manifests )
WHAT TO DO PLZ REPLY ANYONE HAVING SOLUTION…

2 Likes

I have the same problem please help.

This was the worst for me the past couple of days. This fixed it for me java - Unable to Merge Android Manifests at compile time - Stack Overflow

go to assets/plugins/android and update the android manifest file. Change the target sdk version to 24

go to assets/plugins/android and update the android manifest file. Change the target sdk version to 24

go to assets/plugins/android and update the android manifest file. Change the target sdk version to 24

1 Like

Seems to be after sorting it for me anyways. It passed the merging files section. Didn’t actually have sdk version 24 so waiting on that now to test again. Thanking you!!

Changing the target sdk version to 24 did solve that problem and but now gives a new error:

stderr[
AndroidManifest.xml:30: error: No resource identifier found for attribute ‘enableVrMode’ in package ‘android’
]

Virtual Reality Supported is clicked and I’ve tried each of the sdks. There’s 2 lines that stand out in the AndroidManifest and AndroidManifestCardboard which I’ve tried changing to true individually and simultaneously with no change.

EDIT
A gvr github manifest at “https://github.com/googlevr/gvr-android-sdk/blob/master/samples/sdk-treasurehunt/src/main/AndroidManifest.xml” shows the following line:

android:enableVrMode=" @anon_76954444 /gvr_vr_mode_component"

which when added to the manifests seems to not be recognised.

What i did was go to player settings and change the minimum api to the actual minimum api of my sdk

What solved me the problem of merging manifests when using VR is the following:

In Manifest add: xmlns:tools=“http://schemas.android.com/tools
In Application add: tools:replace=“android:theme”

2 Likes

**1.**CommandInvokationFailure: Unable to merge android manifests.
C:/Program Files/Java/jdk1.8.0_131\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir=“C:/SDK/android-sdk-windows/android-sdk-windows\tools” -Dfile.encoding=UTF8 -jar “C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar” -

stderr[

]
stdout[
Warning: [Temp\StagingArea\AndroidManifest-main.xml:2, C:\Users\xuzhiyuan\Desktop\QQ\Temp\StagingArea\android-libraries\unity-android-resources\AndroidManifest.xml:1] Main manifest has but library uses targetSdkVersion=‘26’
]
exit code: 1
UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
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)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
**2.**Error building Player: 2 errors
**3.**Build completed with a result of ‘Failed’
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
**4.**UnityEditor.BuildPlayerWindow+BuildMethodException: 3 errors
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (BuildPlayerOptions options) [0x0020e] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:181
at UnityEditor.BuildPlayerWindow.CallBuildMethods (Boolean askForBuildLocation, BuildOptions defaultBuildOptions) [0x00065] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:88
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

I have this problem when I am packing android. How can I solve this problem?

Thanks @MirkoSon , adding xmlns:tools=“http://schemas.android.com/tools” in the manifest tag for a third party plugin’s AndroidManifest.xml saved my project.