Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Unable to merge android manifest error

Discussion in 'Scripting' started by djoshi, Jan 8, 2015.

  1. djoshi

    djoshi

    Joined:
    Mar 28, 2014
    Posts:
    182
    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.
    http://answers.unity3d.com/questions/643977/unable-to-merge-android-manifests-google-play-game.html
     
  2. djoshi

    djoshi

    Joined:
    Mar 28, 2014
    Posts:
    182
    Anyone Please?
     
  3. iEpic

    iEpic

    Joined:
    Sep 29, 2013
    Posts:
    119
    I'm getting the same error.
    Ever figure it out??
     
  4. paruthi-exe

    paruthi-exe

    Joined:
    Mar 11, 2015
    Posts:
    12
    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
     
    benjaminstrike likes this.
  5. benjaminstrike

    benjaminstrike

    Joined:
    Mar 21, 2014
    Posts:
    14
    YES THANK YOU
     
  6. Bigwater97

    Bigwater97

    Joined:
    Jun 10, 2014
    Posts:
    1
    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.
     
  7. betsillds1990

    betsillds1990

    Joined:
    May 20, 2016
    Posts:
    1
    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 :)
     
    halimozturk likes this.
  8. AURAREALITY

    AURAREALITY

    Joined:
    Dec 26, 2016
    Posts:
    5
    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...
     
    yicyao and yoyo696 like this.
  9. yoyo696

    yoyo696

    Joined:
    Aug 11, 2015
    Posts:
    14
    I have the same problem please help.
     
  10. nickdreamdev

    nickdreamdev

    Joined:
    Oct 25, 2016
    Posts:
    34
  11. lokesh_dangi_

    lokesh_dangi_

    Joined:
    Dec 30, 2016
    Posts:
    3
    go to assets/plugins/android and update the android manifest file. Change the target sdk version to 24
     
  12. lokesh_dangi_

    lokesh_dangi_

    Joined:
    Dec 30, 2016
    Posts:
    3
    go to assets/plugins/android and update the android manifest file. Change the target sdk version to 24
     
  13. lokesh_dangi_

    lokesh_dangi_

    Joined:
    Dec 30, 2016
    Posts:
    3
    go to assets/plugins/android and update the android manifest file. Change the target sdk version to 24
     
    biggsthecat likes this.
  14. biggsthecat

    biggsthecat

    Joined:
    Nov 1, 2013
    Posts:
    9
    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!!
     
  15. biggsthecat

    biggsthecat

    Joined:
    Nov 1, 2013
    Posts:
    9
    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.

    <uses-feature android:name="android.software.vr.mode" android:required="false"/>
    <uses-feature android:name="android.hardware.vr.high_performance" android:required="false"/>

    EDIT
    A gvr github manifest at "https://github.com/googlevr/gvr-and...sdk-treasurehunt/src/main/AndroidManifest.xml" shows the following line:

    android:enableVrMode="@String/gvr_vr_mode_component"

    which when added to the manifests seems to not be recognised.
     
    Last edited: Jan 1, 2017
  16. Josh-Tim

    Josh-Tim

    Joined:
    Dec 8, 2016
    Posts:
    4
    What i did was go to player settings and change the minimum api to the actual minimum api of my sdk
     
  17. MirkoSon

    MirkoSon

    Joined:
    Oct 14, 2015
    Posts:
    24
    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"
     
    theolagendijk and almertineshop like this.
  18. xuzhiyuan4

    xuzhiyuan4

    Joined:
    Mar 18, 2018
    Posts:
    4
    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 <uses-sdk android:targetSdkVersion='24'> 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?
     
  19. theolagendijk

    theolagendijk

    Joined:
    Nov 12, 2014
    Posts:
    117
    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.