由于下载了最新的 SDK 并安装了 Android Studio,我的项目构建失败.我收到以下消息:
Since downloading the latest SDK and installing Android Studio, my project fails to build. I get the following message:
Error:Gradle: Execution failed for task ':SampleProject:processProdDebugManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 14 cannot be smaller than version L declared in library com.android.support:support-v4:21.0.0-rc1
注意:这已更新以反映 API 21 Lollipop 的发布.请务必下载最新的 SDK.
在我的一个模块中,我在 build.gradle 中有以下内容:
In one of my modules I had the following in build.gradle:
dependencies {
compile 'com.android.support:support-v4:+'
}
改成
dependencies {
// do not use dynamic updating.
compile 'com.android.support:support-v4:21.0.0'
}
解决了这个问题.
确保您没有在您的任何地方都包含 com.android.support:support-v4:+
或任何其他支持库(v7、v13、appcompat 等)项目.
Make sure you're not doing a general inclusion of com.android.support:support-v4:+
or any other support libraries (v7, v13, appcompat, etc), anywhere in your project.
我认为问题是 v4:+
选择了 release Candidate (21.0.0-rc1) 最新的 L 版本,这显然需要 L SDK.
I'd assume the problem is v4:+
picks up the release candidate (21.0.0-rc1) latest L release which obviously requires the L SDK.
如果您需要使用新视图(CardView、RecyclerView 和 Palette),以下应该可以工作:
If you need to use the new views (CardView, RecyclerView, and Palette), the following should work:
compile "com.android.support:cardview-v7:21.0.0"
compile "com.android.support:recyclerview-v7:21.0.0"
compile "com.android.support:palette-v7:21.0.0"
(归功于/androiddev 上的 EddieRingle - http://www.reddit.com/r/androiddev/comments/297xli/howto_use_the_v21_support_libs_on_older_versions/)
(Credit to EddieRingle on /androiddev - http://www.reddit.com/r/androiddev/comments/297xli/howto_use_the_v21_support_libs_on_older_versions/)
另一个编辑
请务必在下面查看 @murtuza 关于 appcompat-v7 的回答,如果有帮助,请点赞!
Be sure to see @murtuza's answer below regarding appcompat-v7 and upvote if it helps!
这篇关于清单合并失败:uses-sdk:minSdkVersion 14的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!