简体   繁体   中英

Android Studio gradle fails : compile 'com.android.support:appcompat-v7:21.0.+'

I am new to Android and trying to get material design to work but when I add the dependencies to do so I get the following error:

Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 15 cannot be smaller than version L declared in library com.android.support:appcompat-v7:21.0.0-rc1

I am following instructions on this page: http://developer.android.com/training/material/compatibility.html

21.0.0-rc1是一个非常旧的兼容性库版本,可能是造成此问题的原因,请使用以下命令:

com.android.support:appcompat-v7:23.1.1

you cannot add rc1 at the end, because you don't have that library in you Android studio. You might be having different version. Rather than adding manually, follow the below instructions

RightClick your app -> open module setting (shortcut f4) ->app ->dependency tab -> click (+) Plus -> then add the design library from it. (if the problem is library version then it will be solved)

if still the problem exists trying changing minSDK to 16

Currently you are using 21.0.0-rc1 but you are trying to use a really old version.

You can use numerous SDK aswell:

<uses-sdk android:minSdkVersion="integer"
      android:targetSdkVersion="integer"
      android:maxSdkVersion="integer" />

This will be placed in the manifest.

This can be also done in android studio:

File -> Project Structure -> app -> build Tools version -> select the one you want to lower it too.

For some reasons you are using the library (check your build.gradle )

com.android.support:appcompat-v7:21.0.0-rc1.

This library was a preview of the final v21 and it has minSdk=L (=21).
In your case your are using minSdk=15 < 21.

It is the reason of your issue.

In general you can't use in your project a minSdk lower the minSdk of one of your dependencies

Also it is very important to highlight that you are using a preview (and deprecated) library and you shouldn't use it .

Use the latest version:

com.android.support:appcompat-v7:23.1.1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM