Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
2
Question by ZilvinasKrasauskas · Sep 21, 2016 at 06:26 PM · androidbuildbuild-error

Unable to merge android manifests. Trying to merge incompatible element

Hi,

I'm trying to build my app for Android but for some reason I'm getting three errors, something to do with the android manifests. I've tried everything I could find on the internet, but nothing has worked. Here is the biggest error:

 CommandInvokationFailure: Unable to merge android manifests. See the Console for more details. 
 C:/Program Files/Java/jdk1.8.0_92\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="C:/Users/Algis/Documents/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:4, C:\Users\Algis\Desktop\Fact or Lie\Fact or Lie\Temp\StagingArea\android-libraries\google-play-services_lib\AndroidManifest.xml:4] Trying to merge incompatible /manifest/application/activity[@name=com.unity3d.player.UnityPlayerActivity] element:
   <activity
 --    @android:label="@string/app_name"
 --    @android:name="com.unity3d.player.UnityPlayerActivity">
 --    <intent-filter>
   <activity
 ++    @android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale"
 ++    @android:label="@string/app_name"
 ++    @android:launchMode="singleTask"
 Error: [Temp\StagingArea\AndroidManifest-main.xml, C:\Users\Algis\Desktop\Fact or Lie\Fact or Lie\Temp\StagingArea\android-libraries\play-services-ads-lite-9.4.0\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[
 Warning: [Temp\StagingArea\AndroidManifest-main.xml:1, C:\Users\Algis\Desktop\Fact or Lie\Fact or Lie\Temp\StagingArea\android-libraries\google-play-services_lib\AndroidManifest.xml:14] Main manifest has <uses-feature android:glEsVersion='0x00010000'> but library uses glEsVersion='0x00020000'
 Note: main manifest lacks a <uses-feature android:glEsVersion> declaration, and thus defaults to glEsVersion=0x00010000.
 [Temp\StagingArea\AndroidManifest-main.xml:4, C:\Users\Algis\Desktop\Fact or Lie\Fact or Lie\Temp\StagingArea\android-libraries\GoogleMobileAdsPlugin\AndroidManifest.xml:4] Skipping identical /manifest/application/activity[@name=com.unity3d.player.UnityPlayerActivity] element.
 [Temp\StagingArea\AndroidManifest-main.xml, C:\Users\Algis\Desktop\Fact or Lie\Fact or Lie\Temp\StagingArea\android-libraries\play-services-ads-lite-9.4.0\AndroidManifest.xml:11] Skipping identical /manifest/application/activity[@name=com.google.android.gms.ads.purchase.InAppPurchaseActivity] element.
 [Temp\StagingArea\AndroidManifest-main.xml, C:\Users\Algis\Desktop\Fact or Lie\Fact or Lie\Temp\StagingArea\android-libraries\play-services-base-9.4.0\AndroidManifest.xml:4] Skipping identical /manifest/application/activity[@name=com.google.android.gms.common.api.GoogleApiActivity] element.
 [Temp\StagingArea\AndroidManifest-main.xml, C:\Users\Algis\Desktop\Fact or Lie\Fact or Lie\Temp\StagingArea\android-libraries\play-services-basement-9.4.0\AndroidManifest.xml:5] Skipping identical /manifest/application/meta-data[@name=com.google.android.gms.version] 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)
 UnityEditor.HostView:OnGUI()

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

3 Replies

· Add your reply
  • Sort: 
avatar image
4
Best Answer

Answer by liortal · Sep 21, 2016 at 08:17 PM

A bit background on what Unity does when you build your project: For Android projects, Unity uses a pre-built Android "project" structure, with a manifest, libraries, etc.

Unity also allows you to add a custom Android manifest, and to use android libraries (.aar files or Android Library projects that are folders with a specific structure and contents).

When building your project, it has to merge all manifests together to form a single manifest for the app. Usually, this process works fine but in some cases it may fail (as in your case).

When manifest merging fails, Unity outputs a message that shows you what went wrong. For example, in your case:

Error: [Temp\StagingArea\AndroidManifest-main.xml, C:\Users\Algis\Desktop\Fact or Lie\Fact or Lie\Temp\StagingArea\android-libraries\play-services-ads-lite-9.4.0\AndroidManifest.xml:10] Trying to merge incompatible /manifest/application/activity[@name=com.google.android.gms.ads.AdActivity] element: @android:name="com.google.android.gms.ads.AdActivity"> -- --(end reached) @android:name="com.google.android.gms.ads.AdActivity" ++ @android:theme="@android:style/Theme.Translucent"> ++ ]

This error means that:

  1. Some element is defined twice (e.g: in 2 different AndroidManifest.xml files)

  2. ...and that it is defined differently somehow, so the merger doesn't know how to merge it into a single entry.

In your example - you can see that you have 2 different definitions of the com.google.android.gms.ads.AdActivity activity. in one of them some more information is provided (e.g: theme) while in the other it is not present.

You should look at these errors and find out why you have duplicate definitions of these elements (activities) and eliminate these duplications.

NOTE: I provide a service for fixing Android build issues with Unity. In any cases where you cannot resolve this issue yourself, you can always contact me :)

Comment
Add comment · Show 9 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image ZilvinasKrasauskas · Sep 23, 2016 at 01:00 PM 0
Share

I think I'm making some progress but I keep getting this error that isn't allowing me to build the program:

 Error: [Temp\StagingArea\Android$$anonymous$$anifest-main.xml, C:\Users\Algis\Desktop\Fact or Lie\Fact or Lie\Temp\StagingArea\android-libraries\play-services-ads-lite-9.6.0\Android$$anonymous$$anifest.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>

Could you help me out and tell me how I could fix this? I would buy your service but I can't in this case.

avatar image liortal ZilvinasKrasauskas · Sep 24, 2016 at 07:42 PM 0
Share

Did you read my answer above? you have 2 definitions of the same activity - com.google.android.gms.ads.AdActivity

One is included in play-services-ads-lite-9.6.0.aar (this is a .zip file with a different extension. it includes its own manifest inside). The other copy has to be somewhere in the project. i cannot see it in the error message your provided, but you should look for it in other manifests.

avatar image ZilvinasKrasauskas liortal · Sep 24, 2016 at 08:16 PM 0
Share

You're awesome! I had a google play services lib folder hidden in my project, and when I deleted the program started building like normal. Thank you so much!

avatar image ZilvinasKrasauskas · Sep 24, 2016 at 08:03 PM 0
Share

Sorry, I'm not educated on these matters. I got rid of the errors by deleting the play-services-ads-lite .aar package, however I'm still getting one error that I have no idea on how to fix.

http://pastebin.com/hDfWkZyg (Too long to post in this)

Any clues? Appreciate it, will mark your answer as the best answer whenever I get this build working, quite frustrating.

avatar image liortal ZilvinasKrasauskas · Sep 24, 2016 at 08:06 PM 0
Share

the message is truncated (see at its ending). you should open the editor log and paste that on pastebin (in the console window -> top right corner there's a smaller button, open the editor log from it)

avatar image ZilvinasKrasauskas liortal · Sep 24, 2016 at 08:09 PM 0
Share

$$anonymous$$y bad, thanks. http://pastebin.com/v4$$anonymous$$emyG$$anonymous$$ Hope this is good.

Show more comments
avatar image manishpatil · Dec 21, 2016 at 10:58 AM 0
Share

@liortal I am very very beginner to Unity and zero in coding.. I just create builds. I am getting similar error, can you please help me below is my error in console : CommandInvokationFailure: Unable to merge android manifests. See the Console for more details. /Library/Java/JavaVirtual$$anonymous$$achines/jdk1.8.0_111.jdk/Contents/Home/bin/java -Xmx2048$$anonymous$$ -Dcom.android.sdkmanager.toolsdir="/Users/mangoreader/Android/tools" -Dfile.encoding=UTF8 -jar "/Applications/Unity/PlaybackEngines/AndroidPlayer/Tools/sdktools.jar" -

 stderr[
 
 ]
 stdout[
 Warning: [Temp/StagingArea/Android$$anonymous$$anifest-main.xml:60, /Users/mangoreader/Desktop/Repo/livelike-unity/LivelikeV2/Temp/StagingArea/android-libraries/LocalyticsConfig/Android$$anonymous$$anifest.xml:3] $$anonymous$$ain manifest has <uses-sdk android:targetSdkVersion='23'> but library uses targetSdkVersion='24'
 ]
 UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String error$$anonymous$$sg)
 UnityEditor.Android.AndroidSD$$anonymous$$Tools.RunCommandInternal (System.String javaExe, System.String sdkToolsDir, System.String[] sdkToolCommand, Int32 memory$$anonymous$$B, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String error$$anonymous$$sg)
 UnityEditor.Android.AndroidSD$$anonymous$$Tools.RunCommandSafe (System.String javaExe, System.String sdkToolsDir, System.String[] sdkToolCommand, Int32 memory$$anonymous$$B, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String error$$anonymous$$sg)
 UnityEditor.HostView:OnGUI()
avatar image manishpatil manishpatil · Dec 21, 2016 at 12:20 PM 0
Share

Hey Thanks man, it got resolved on updating my android studio

avatar image
0

Answer by Gurosoft · Sep 28, 2017 at 02:09 PM

Hello. I have the SAME problem. Then Only in one of my 3 AndroidManifest I have this :

I eliminated this. (The repeat appear in Temp folder.

Then Error disapear.. but..Interstitials Ads don't load! Then I still have a problem!

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by unity_17APQiOLR39kog · Sep 06, 2018 at 01:44 PM

Update play service resolver.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

8 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Silent Android build failure 7 Answers

il2cpp android build error unity 2019.1.6f1 6 Answers

Android Build Fail, CommandInvokationFailure 1 Answer

Unity Android IL2CPP Build Error 1 Answer

Android build error: unrecognized pixel format 264 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges