清单合并失败:uses-sdk:minSdkVersion 14

Manifest merger failed : uses-sdk:minSdkVersion 14(清单合并失败:uses-sdk:minSdkVersion 14)
本文介绍了清单合并失败:uses-sdk:minSdkVersion 14的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

由于下载了最新的 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

IncompatibleClassChangeError after updating to Android Build Tools 25.1.6 GCM / FCM(更新到 Android Build Tools 25.1.6 GCM/FCM 后出现 IncompatibleClassChangeError)
How to get current flavor in gradle(如何在 gradle 中获取当前风味)
How to fix quot;unexpected element lt;queriesgt; found in lt;manifestgt;quot; error?(如何修复“意外元素lt;查询gt;在“清单中找到错误?)
Multi flavor app based on multi flavor library in Android Gradle(基于 Android Gradle 中多风味库的多风味应用)
Android dependency has different version for the compile and runtime(Android 依赖在编译和运行时有不同的版本)
Transitive dependencies for local aar library(本地 aar 库的传递依赖)