問題描述
由于下載了最新的 SDK 并安裝了 Android Studio,我的項(xiàng)目構(gòu)建失敗.我收到以下消息:
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 的發(fā)布.請務(wù)必下載最新的 SDK.
在我的一個(gè)模塊中,我在 build.gradle 中有以下內(nèi)容:
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'
}
解決了這個(gè)問題.
確保您沒有在您的任何地方都包含 com.android.support:support-v4:+
或任何其他支持庫(v7、v13、appcompat 等)項(xiàng)目.
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.
我認(rèn)為問題是 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),以下應(yīng)該可以工作:
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/)
另一個(gè)編輯
請務(wù)必在下面查看 @murtuza 關(guān)于 appcompat-v7 的回答,如果有幫助,請點(diǎn)贊!
Be sure to see @murtuza's answer below regarding appcompat-v7 and upvote if it helps!
這篇關(guān)于清單合并失敗:uses-sdk:minSdkVersion 14的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!