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
0
Question by INSIX · Dec 14, 2016 at 03:21 PM · androidandroid buildadmobgoogle play games

Having trouble building android project after adding Google Play Games and Google adMob

I could build fine with just google play services but when I added the admob plugin I ran into these errors. Any help would be much appreciated.

The first one

Error: [Temp/StagingArea/AndroidManifest-main.xml:2, /Users/admin/Bottle Flip/Temp/StagingArea/android-libraries/MainLibProj/AndroidManifest.xml:3] Main manifest has but library uses minSdkVersion='15'

UnityEditor.HostView:OnGUI()

Then the second one

CommandInvokationFailure: Unable to merge android manifests. See the Console for more details. /Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home/bin/java -Xmx2048M -Dcom.android.sdkmanager.toolsdir="/Users/admin/Library/Android/sdk/tools" -Dfile.encoding=UTF8 -jar "/Applications/Unity/PlaybackEngines/AndroidPlayer/Tools/sdktools.jar" -

stderr[ Error: [Temp/StagingArea/AndroidManifest-main.xml:2, /Users/admin/Bottle Flip/Temp/StagingArea/android-libraries/MainLibProj/AndroidManifest.xml:3] Main manifest has but library uses minSdkVersion='15' ] stdout[ Warning: [Temp/StagingArea/AndroidManifest-main.xml:2, /Users/admin/Bottle Flip/Temp/StagingArea/android-libraries/MainLibProj/AndroidManifest.xml:3] Main manifest has but library uses targetSdkVersion='23' [Temp/StagingArea/AndroidManifest-main.xml, /Users/admin/Bottle Flip/Temp/StagingArea/android-libraries/play-services-base-9.6.1/AndroidManifest.xml:4] Skipping identical /manifest/application/activity[@name=com.google.android.gms.common.api.GoogleApiActivity] element. [Temp/StagingArea/AndroidManifest-main.xml, /Users/admin/Bottle Flip/Temp/StagingArea/android-libraries/play-services-basement-9.6.1/AndroidManifest.xml:5] Skipping identical /manifest/application/meta-data[@name=com.google.android.gms.version] element. Warning: [Temp/StagingArea/AndroidManifest-main.xml:2, /Users/admin/Bottle Flip/Temp/StagingArea/android-libraries/unity-ads/AndroidManifest.xml:3] Main manifest has but library uses targetSdkVersion='23' ] 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()

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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by liortal · Dec 14, 2016 at 08:05 PM

Both of the issues you described are actually the same problem.

Background

Error: [Temp/StagingArea/AndroidManifest-main.xml:2, /Users/admin/Bottle Flip/Temp/StagingArea/android-libraries/MainLibProj/AndroidManifest.xml:3] Main manifest has but library uses minSdkVersion='15'

Your Unity project has an Android manifest of its own (a default one, or a custom one that you can set yourself).

Other Android libraries (plugins) that you add to your project can also contain their own Android manifest, and so the build process has to include (merge) all these manifests together.

Usually, this operation succeeds and is transparent to you as a developer. However, there may be cases where the automatic merging cannot decide how to act properly and so the build process fails.

Root cause for this issue

Taking a look at the error message you posted:

stderr[ Error: [Temp/StagingArea/AndroidManifest-main.xml:2, /Users/admin/Bottle Flip/Temp/StagingArea/android-libraries/MainLibProj/AndroidManifest.xml:3] Main manifest has but library uses minSdkVersion='15' ] stdout[ Warning: [Temp/StagingArea/AndroidManifest-main.xml:2, /Users/admin/Bottle Flip/Temp/StagingArea/android-libraries/MainLibProj/AndroidManifest.xml:3] Main manifest has but library uses targetSdkVersion='23' [Temp/StagingArea/AndroidManifest-main.xml, /Users/admin/Bottle Flip/Temp/StagingArea/android-libraries/play-services-base-9.6.1/AndroidManifest.xml:4]

A bit hard to figure out since the phrasing is a bit off, but you can see that the library uses minSdkVersion = 15, but your main Unity project defines minSdkVersion = 23.

The manifest merger cannot decide which value to pick up.

Solution

You should set this value to match across all used libraries (plugins). The easiest solution would be to set the "Minimum API level" in Player settings to 15.

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Google Admob (V.6.1.2) crashing Android game on device built with Unity 2020.3.19 1 Answer

IOException : Failed to Move File / Directory 4 Answers

Possible conflict between plugin, error on build 1 Answer

CommandInvokationFailure: Unable to convert classes into dex format - Unity 1 Answer

com.google.android.gms.ads.MobileAds Issue With Firebase 1 Answer


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