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.

Search all android manifest in you project and change them one by one… this should be work…

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 1.