Search Unity

  1. Unity 2019.1 beta is now available.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We're looking for insight from anyone who has experience with game testing to help us better Unity. Take our survey here. If chosen to participate you'll be entered into a sweepstake to win an Amazon gift card.
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Unity 2018.3 is now released.
    Dismiss Notice
  6. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

Unable to merge android manifests

Discussion in 'Daydream' started by FlaxoIce, Jan 6, 2017.

  1. FlaxoIce

    FlaxoIce

    Joined:
    Jan 29, 2015
    Posts:
    3
    CommandInvokationFailure: Unable to merge android manifests. See the Console for more details.
    C:/Program Files/Java/jdk1.8.0_111\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="C:\Users\Ideapad\AppData\Local\Android\sdk\tools" -Dfile.encoding=UTF8 -jar "C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -

    stderr[

    ]
    stdout[
    Warning: [Temp\StagingArea\AndroidManifest-main.xml:1] Missing 'package' attribute in manifest.
    Warning: [Temp\StagingArea\AndroidManifest-main.xml:14, D:\gvr-unity-sdk-master\gvr-unity-sdk-master\Samples\TESTING\Temp\StagingArea\android-libraries\gvr-permissionsupport-release\AndroidManifest.xml:3] Main manifest has <uses-sdk android:targetSdkVersion='22'> but library uses targetSdkVersion='24'
    ]
    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.WaitingForProc
     
  2. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    531
    > Main manifest has <uses-sdk android:targetSdkVersion='22'> but library uses targetSdkVersion='24'

    Have you set the target SDK to Nougat?
     
    FlaxoIce and samurai926 like this.
  3. mpgholden

    mpgholden

    Joined:
    Aug 21, 2014
    Posts:
    16
    Try deleting your AndroidManifest file and letting Unity generate one at build time.
     
  4. mitt88

    mitt88

    Joined:
    Dec 27, 2016
    Posts:
    1
    I had the same issue and changing the manifest under assets->plugins->android solved it for me.

    <uses-sdkandroid:minSdkVersion="19"android:targetSdkVersion="24"/>
     
    samurai926 likes this.
  5. samurai926

    samurai926

    Joined:
    Jun 30, 2014
    Posts:
    14
    Thanks this worked for me. I had to manually bump targetSdkVersion in both AndroidManifest.xml and AndroidManifest-Cardboard.xml from 22 to 24. (Unity 5.5.0f3). Looks like same worked for mitt88 too
     
  6. FlaxoIce

    FlaxoIce

    Joined:
    Jan 29, 2015
    Posts:
    3
    Thank you all, it worked like a charm.
     
  7. ninjanosui

    ninjanosui

    Joined:
    Jul 12, 2013
    Posts:
    27
    if I set the target sdk to nougat I get :Error building Player: FormatException: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
     
  8. TARTs

    TARTs

    Joined:
    Jan 2, 2013
    Posts:
    44
    This worked for me. Changing in .xml not working.

    Change target in Player Setting to " Nougat " and build 1 times > Then change back to target what do you want then build.
     
  9. zagham

    zagham

    Joined:
    Aug 17, 2012
    Posts:
    1
    just update your target sdk to 24 it will solve your problem

    target sdk mean android sdk you have installed
     
    ajfwebdesign likes this.
  10. karim7

    karim7

    Joined:
    Mar 8, 2015
    Posts:
    4
    just update you SDK new update
     
  11. CrazyApplesStudio

    CrazyApplesStudio

    Joined:
    Jan 18, 2018
    Posts:
    25
    Well i have the same issue and the solutions here do not seem to solve my problem, am i missing something?


    Edit: I cannot seem to attach imgur to the post so here is the editor error with player settings: https://imgur.com/lHCw1kT

    Edit 2 : Never mind , i updated to SDK 25 and seems to have solved this issue at the expense of generating another one "Unable to re-package resources".
     
    Last edited: Mar 22, 2018
  12. ybahassine

    ybahassine

    Joined:
    Mar 20, 2018
    Posts:
    1
    guys please i need some help here, i tried everything but i still have these errors



    Error: [Temp\StagingArea\AndroidManifest-main.xml:19, C:\Users\wierdo\Documents\ball1\Temp\StagingArea\android-libraries\play-services-ads-lite-11.0.4\AndroidManifest.xml:10] Trying to merge incompatible /manifest/application/activity[@name=com.google.android.gms.ads.AdActivity] element:

    UnityEditor.HostView:OnGUI()


    and



    CommandInvokationFailure: Unable to merge android manifests. See the Console for more details.
    C:/Program Files/Java/jdk1.8.0_161\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="C:/Users/wierdo/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:19, C:\Users\wierdo\Documents\ball1\Temp\StagingArea\android-libraries\play-services-ads-lite-11.0.4\AndroidManifest.xml:10] Trying to merge incompatible /manifest/application/activity[@name=com.google.android.gms.ads.AdActivity] element:
    <activity
    -- @android:name="com.google.android.gms.ads.AdActivity">
    --</activity>
    --(end reached)
    <activity
    ++ @android:name="com.google.android.gms.ads.AdActivity"
    ++ @android:theme="@android:style/Theme.Translucent">
    ++</activity>
    ]
    stdout[
    [Temp\StagingArea\AndroidManifest-main.xml:4, C:\Users\wierdo\Documents\ball1\Temp\StagingArea\android-libraries\google-play-services_lib\AndroidManifest.xml:5] Skipping identical /manifest/application/meta-data[@name=com.google.android.gms.version] element.
    [Temp\StagingArea\AndroidManifest-main.xml:4, C:\Users\wierdo\Documents\ball1\Temp\StagingArea\android-libraries\play-services-basement-11.0.4\AndroidManifest.xml:5] Skipping identical /manifest/application/meta-data[@name=com.google.android.gms.version] element.
    ]
    exit code: 1
    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)
    UnityEditor.HostView:OnGUI()
     
  13. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    531
    You have a problem with an activity in one manifest: @android:name="com.google.android.gms.ads.AdActivity" trying to be merged with an activity with the same name in a separate manifest that has different attributes. You should probably remove on of these as they look to be the offenders:

    ball1\Temp\StagingArea\android-libraries\google-play-services_lib\AndroidManifest.xml:5] Skipping identical /manifest/application/meta-data[@name=com.google.android.gms.version] element.

    ball1\Temp\StagingArea\android-libraries\play-services-basement-11.0.4\AndroidManifest.xml:5] Skipping identical /manifest/application/meta-data[@name=com.google.android.gms.version] element.

    You probably only need one or the other of those I would guess.
     
  14. Jacebook

    Jacebook

    Joined:
    Jan 11, 2018
    Posts:
    9
    I've got the same problem as ybahassine (I'm also trying to implement Google Admob ads and having exactly the same errors). I'm not sure how I can remove one of the manifests, as it is creating them during the Build process.
     
  15. rrrus

    rrrus

    Official Google Employee

    Joined:
    Jul 13, 2015
    Posts:
    14
  16. Hany33

    Hany33

    Joined:
    Jun 23, 2018
    Posts:
    1
    Dear Jacebook. Do your problem solved?