我使用Leanback的库,这需要Android的17或更高版本。但是我的应用程序支持16的minSDK,所以我从摇篮得到一个编译错误说
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
当我看build工具文档,我看到如何在 overrideLibrary
标记添加到我的表现,但问题是,我宣布了我的minSdk在我的摇篮文件,而不是我的清单。
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.
我如何使用 overrideLibrary
当minSdk在build.gradle,而不是在AndroidManifest.xml中声明?
How do I use overrideLibrary
when the minSdk is declared in build.gradle instead of in AndroidManifest.xml?
推荐答案
如果您使用的是Android的工作室:
If you are using Android Studio:
添加<使用-SDK工具:overrideLibrary =android.support.v17.leanback/>
来您的清单,不要忘了包括的xmlns:工具=http://schemas.android.com/tools
太
add <uses-sdk tools:overrideLibrary="android.support.v17.leanback"/>
to your manifest, don't forget to include xmlns:tools="http://schemas.android.com/tools"
too.
相关推荐
最新文章