Android Unable to merge manifest Error
Hello, when I try to build my project I get the following errors: Error: [Temp\StagingArea\AndroidManifest-main.xml:2, D:\UnityProjects\TravelChallenge\Temp\StagingArea\android-libraries\customtabs-23.4.0\AndroidManifest.xml:3] Main manifest has but library uses minSdkVersion='15' Error: [Temp\StagingArea\AndroidManifest-main.xml:2, D:\UnityProjects\TravelChallenge\Temp\StagingArea\android-libraries\facebook-android-sdk-4.17.0\AndroidManifest.xml:3] Main manifest has but library uses minSdkVersion='15' Error: [Temp\StagingArea\AndroidManifest-main.xml:2, D:\UnityProjects\TravelChallenge\Temp\StagingArea\android-libraries\facebook-android-wrapper-7.9.4\AndroidManifest.xml:3] Main manifest has but library uses minSdkVersion='15'
However, I have already changed the minSDK in the Project/Plugin/Android/Manifest to version 14 but when building the project it still creates the TEMP/Manifests which have the minSDK version 15. Is there any way that I can avoid these TEMP Manifests ? Otherwise even if I edit them on every new build they are replaced with new ones that have the minSDK version 15.
Answer by liortal · Apr 23, 2017 at 06:23 AM
Background
In the final .APK package, there's only a single (1) AndroidManifest.
When building your project for Android, Unity uses a "main manifest" (default pre-made one, or a custom one, provided by you under Assets/Plugins/Android).
When adding other plugin libraries, Unity will merge all manifests together to form a single, merged manifest for the built .APK.
In case these manifests contain conflicting entries (in the main manifest vs. library manifests), Unity will generate an error such as the one you're getting.
The error usually contains the root cause for failure, along with the paths of the manifest file).
In your case:
[Temp\StagingArea\AndroidManifest-main.xml:2, D:\UnityProjects\TravelChallenge\Temp\StagingArea\android-libraries\customtabs-23.4.0\AndroidManifest.xml:3] Main manifest has but library uses minSdkVersion='15' Error: [Temp\StagingArea\AndroidManifest-main.xml:2, D:\UnityProjects\TravelChallenge\Temp\StagingArea\android-libraries\facebook-android-sdk-4.17.0\AndroidManifest.xml:3] Main manifest has but library uses minSdkVersion='15' Error: [Temp\StagingArea\AndroidManifest-main.xml:2, D:\UnityProjects\TravelChallenge\Temp\StagingArea\android-libraries\facebook-android-wrapper-7.9.4\AndroidManifest.xml:3] Main manifest has but library uses minSdkVersion='15'
This particular error message is a bit strange - the phrasing is not really that great. you can understand that the main manifest sets minSdkVersion to something, while other libraries in your project (Facebook, customtabs) set it to 15.
Solution
Set your minimal SDK version (Under Player Settings -> Other Settings) to 15. If you have a custom android manifest under Assets/Plugins/Android/AndroidManifest.xml, make sure it sets this value to 15 as well.
NOTE: in case you can't resolve the issue yourself, I offer my expertise for resolving this kind of Android build issues. More info can be found in this link.
Hello liortal how to fix my problem? http://answers.unity3d.com/questions/1344074/please-help-what-can-i-do-here.html Please help me..
NV$$anonymous$$ i already solved it thank you ill try that in a future :) if there's another problem>.<
Answer by MrCrumbl3d · Apr 23, 2017 at 03:02 AM
Search all android manifest in you project and change them one by one.... this should be work...
Like I said in the description. It doesn't matter if I change it in the Project/Temp folder because every time you build the project they are being reset. $$anonymous$$y question is how can I avoid the creation of a TE$$anonymous$$P folder or is there anything else to do except editing the $$anonymous$$anifest file in Plugins/Android ?
what android adk do you have already installed?
Your answer
Follow this Question
Related Questions
Unity 5.6.2.1f Android Build Error 0 Answers
Unable to merge Android manifests. (5.6.0p3) 2 Answers
Build Error from Android Manifest 0 Answers
help with build error 0 Answers