I'm using the leanback libraries, which require Android 17 or later. However my app supports a minSDK of 16, so I get a build error from gradle saying
Error:Execution failed for task ':Tasks:processPhoneDebugManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 16 cannot be smaller than version 17 declared in library /Users/mike/Projects/android-for-dummies-v3/Tasks/build/intermediates/exploded-aar/com.android.support/leanback-v17/21.0.2/AndroidManifest.xml
Suggestion: use tools:overrideLibrary="android.support.v17.leanback" to force usage
When I look at the build tools documentation, I see how to add the overrideLibrary
marker to my manifest, but the problem is that I'm declaring my minSdk in my gradle file instead of in my manifest.
How do I use overrideLibrary
when the minSdk is declared in build.gradle instead of in AndroidManifest.xml?
The initial process would be to open the manifest application known as the AndroidManifest. xml and then click on the Merged Manifest tab below your edit pane. Following which, Click on the merged manifest option. An Error would be visible at the right column and then one must try to solve the error.
In Android Studio 3.3 you can also see Merged Manifest by clicking on Merged Manifest tab. It's showed at the bottom of the editor pane when you open your standard project manifest.
Android Manifest usually contains pre-defined or static information which is then used to run the app. However, Android toolchain provides customization by allowing you to specify dynamic information through variable declaration, generally referred as Android Manifest placeholders.
Open Android Studio -> Open Manifest File
add
<uses-sdk tools:overrideLibrary="android.support.v17.leanback"/>
don't forget to include xmlns:tools="http://schemas.android.com/tools"
too, before the <application>
tag
it doesn't matter that you declare your minSdk in build.gradle. You have to copy overrideLibrary
in your AndroidManifest.xml
, as documented here.
<manifest
... >
<uses-sdk tools:overrideLibrary="com.example.lib1, com.example.lib2"/>
...
</manifest>
The system automatically ignores the sdkVersion declared in AndroidManifest.xml.
I hope this solve your problem.
<manifest xmlns:tools="http://schemas.android.com/tools" ... >
<uses-sdk tools:overrideLibrary="nl.innovalor.ocr, nl.innovalor.corelib" />
I was facing the issue of conflict between different min sdk versions. So this solution worked for me.
just changed only android:minSdkVersion="16" and it's work perfect C:\MyApp\platforms\android\CordovaLib\AndroidManifest.xml
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With