By loeschg

2014-06-26 19:00:51 8 Comments

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


@Subhojit Halder 2019-07-30 21:26:51

Solution: Manifest merger failed Attribute [email protected] ...

If you are using any latest & greatest Firebase libraries or any other libraries, those are actually using AndroidX instead of then you might have the issue as Manifest merger failed!! So, in this case, your project needs to migrate to AndroidX. So follow the link:

Or watch this video. Thank you.

@Joey 2019-07-30 22:20:21

A link to a solution is welcome, but you should ensure your answer is also useful without it. It's better to add context around the link and describe the most relevant part of the tutorial you're linking to in case the target page is unavailable.

@Subhojit Halder 2019-07-31 22:14:20

Nice to hear from you #Joey. Let me add some extra description. Thanks.

@Kim Kim 2019-07-17 10:35:57

Just target the required minSdkVersion i.e change to the needed one In my case minSdkVersion was 14.

Changing to minSdkVersion 16 solved the issue

compileSdkVersion 29
    defaultConfig {
        applicationId "e.futaaapp"
        minSdkVersion 14
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

compileSdkVersion 29
    defaultConfig {
        applicationId "e.futaaapp"
        minSdkVersion 16
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

@Manohar Reddy Poreddy 2019-05-19 07:15:10

The best way is to let the Android Studio fix the issue.

I did the below, and it worked fine.

  1. Open your project in Android Studio, errors will be popup, if there is a link given to fix it click on it.

  2. Re-open your project in Android Studio, errors will be popup, there will be a link this time if it's not given in the Step 1, click on the given link to fix it.

Note that both operations took several minutes of time, but fixed all issues.

@Codemaker 2019-02-01 18:26:26

You just change Minimum API Level from Build Settings -> Player Settings -> Other Settings -> Minimum SDK Level to some higher version.

@userM1433372 2014-11-17 07:12:18

<uses-sdk tools:node="replace" />

No longer works.

change uses-sdk to

<uses-sdk tools:overrideLibrary="com.packagename.of.libary.with.conflict" />

and add
xmlns:tools="" in the AndroidManifest.xml file

@IgorGanapolsky 2015-03-02 17:16:20

@Ruberandinda Patience 2018-06-21 07:16:31

For me the issue like this is solved by changing the

minSdkVersion 14

In the build.gladdle file and use the one that is specified in the error message

but the issue was

Manifest merger failed : uses-sdk:minSdkVersion 14 cannot be smaller than version 15 declared in library

So I changed from 14 to 15 in the build.gladdle file and it works

give it a try.

@Illegal Argument 2014-07-23 16:52:10

For people facing this issue in the Android Studio beta, the accepted answer didn't solve my problem. Importing a project downloaded from GitHub, I had the following in my build.gradle file of app giving an error in question:

 dependencies {
    compile ''

But in my external library folder I have this folder:

support-v4-21.0.0-rc1 //note the 21

I solved the above problem by changing the dependency to:

dependencies {
compile '' //20 used less than available strange but works

Note: you might also need to download api level lower than the currently available in Android Studio for some library and projects for this to work properly.

@Fattie 2014-10-05 13:46:17

This does seem to be the fundamental issue: "wherever you see ''" ... "make sure you have the up-to-date value" That's about the size of it!

@ProllyGeek 2016-04-28 01:47:54

for people building hybrid apps using cordova CLI, this command will help:

cordova build android -- --minSdkVersion=15

yes it uses double double dashes as you saw it.

@Ionut Necula 2017-08-28 13:36:44

Does this resolve the actual problem? No. It only works like that, but with cordova run android it fails.

@ProllyGeek 2017-08-28 14:10:54

@lonut do you know what actual problem is ?

@Ionut Necula 2017-08-28 14:52:12

In my case the problem is a plugin I'm using called cordova-plugin-facebook4. Unistalling it makes cordova run android work just fine. Unfortunately I didn't found any solution to this anywhere. I manually tried to add the minSdkVersion myself in the AndroidManifest but is being overwritten. Still trying to figure it out.

@ProllyGeek 2017-08-28 16:12:28

@lonut I am using same plugin in some app I am working on, let me know if I can help. However you need to review the build.gradle file, maybe if you provide extra info I can help.

@Ionut Necula 2017-08-29 07:30:27

I finally solved it by changing the minSdk version to 15 in config.xml. The line: <preference name="android-minSdkVersion" value="14" />. This way the AndroidManifest file is being updated also with the new version.

@abelabbesnabi 2015-09-18 18:52:40

The only thing that worked for me is this:

In, I changed: to

@Vova K. 2014-09-08 21:21:04

I have the second solution:

  1. unzip to sdk\platforms\
  2. change build.gradle like

    compileSdkVersion 21
    buildToolsVersion "20.0.0"
    defaultConfig {
        applicationId ""
        minSdkVersion 10
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
  3. add

    <uses-sdk tools:node="replace" /> 

    in Manifest with xmlns:tools="";

  4. Go to sdk\extras\android\m2repository\com\android\support\support-v4\21.0.0-rc1\

unpack support-v4-21.0.0-rc1.aar and edit AndroidManifest.xml like


        android:targetSdkVersion="L" />


        android:targetSdkVersion="21" />

P.S. You can do this with all support libraries that need.

@Ankur Loriya 2014-09-17 12:14:02

I have changed "L" and restarted android studio but getting same issue when build project (ctrl+f9)

@ea_ 2015-04-06 14:45:58

In Android Studio 1.1.0: File - Project Structure - Tab Flavors - Select Min SDK Version which is higher than in Manifest

@AG1 2015-04-01 07:17:34

I have some projects where I prefer to target L.MR1(SDKv22) and some projects where I prefer KK(SDKv19). Your result may be different, but this worked for me.

// Targeting L.MR1 (Android 5.1), SDK 22
android {
    compileSdkVersion 22
    buildToolsVersion "22"

    defaultConfig {
        minSdkVersion 9
        targetSdkVersion 22

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])

    // google support libraries (22)
    compile ''
    compile ''
    compile ''
    compile ''

// Targeting KK (Android 4.4.x), SDK 19
android {
    compileSdkVersion 19
    buildToolsVersion "19.1"

    defaultConfig {
        minSdkVersion 9
        targetSdkVersion 19

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])

    // google libraries (19)
    compile ''
    compile ''
    compile ''
    compile ''

@loeschg 2014-06-26 19:13:44

Note: This has been updated to reflect the release of API 21, Lollipop. Be sure to download the latest SDK.

In one of my modules I had the following in build.gradle:

dependencies {
    compile ''

Changing this to

dependencies {
    // do not use dynamic updating.
    compile '' 

fixed the issue.

Make sure you're not doing a general inclusion of or any other support libraries (v7, v13, appcompat, etc), anywhere in your project.

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.


If you need to use the new views (CardView, RecyclerView, and Palette), the following should work:

compile ""
compile ""
compile ""

(Credit to EddieRingle on /androiddev -

Another Edit

Be sure to see @murtuza's answer below regarding appcompat-v7 and upvote if it helps!

@Arnaud 2014-06-26 19:41:27

What about a library compiled from Maven ? How to exclude the "old" dependancy ?

@loeschg 2014-06-26 19:44:09

@Arnaud not sure there's a way around that. Somebody else will have to comment on that. I'd suggest opening a pull request and/or issue if the project is open source.

@AndroidGecko 2014-06-27 07:12:36

@Arnaud compile("blah:blah:bla") {exclude group: '', module: 'support-v4'}

@Michel 2014-06-28 21:50:53

Note that to use CardView, RecyclerView and Palette, you will also have to alter your Manifest to avoid the merge conflict gradle throws. See this link for details:…

@eipipuz 2014-07-01 21:24:27

In my case I had to remove it from local maven as gauravsapiens commented.

@MartinMcB 2014-07-02 13:13:35

worked, thanks. found this as well…

@Daniele Segato 2014-07-02 15:21:38

Never, ever, suggest people to use + in the dependency version. ALWAYS specify the exact version of the library you want to use (or is available at the time you write the code). Even 20.+ is bad. And if a library you depends on follow this BAD practice consider excluding its dependency and providing your own version of that dependency. This makes your build reproducible at any time. Please improve your answer buy removing your suggestion to use + in the dependency version.

@Xavier Ducrohet 2014-07-02 18:39:14

What @DanieleSegato said. Do not recommend dynamic versioning ever. It's bad practices.

@loeschg 2014-07-02 19:12:09

@XavierDucrohet @DanieleSegato, I updated the answer. What should the v7 support library version be? or variations I tried don't seem to work. I changed the previous to 20.0.0 (which seems to work fine).

@Xavier Ducrohet 2014-07-02 19:26:04

@loeschg those libraries are only available in 21.0.0-rc1 so you should put that. When we update to rc2 or the final version you'll need to manually update it but that's better than never doing it, forgetting about it and later be hit when we release 22-rc1 which breaks the project somehow.

@sud007 2015-04-22 10:55:20

@DanieleSegato said this right. It's bad practice to use '+' as identifier for future versions. I have been using compile '' and this fixed the issue. But do not forget to update the support library version from SDK manager.

@MBH 2015-07-26 14:11:57

compile '' this is the compatible cardview

@Lina Shyshova 2014-09-25 06:50:49

    force = true

Helped me, taken from here

@min2bro 2014-08-17 16:47:28

I also had the same issue and changing following helped me:


dependencies {
    compile ''


dependencies {
 compile ''

@min2bro 2014-09-17 13:46:30

it;s not a code. you need to make this change in your build.gradle file.

@Deepthi 2014-08-21 18:45:32

Thank you @Murtuza. Your answer helped me to solve my problem but in my case

compile ' also, along with

compile '' compile ''

from compile '' compile '' compile '' Hope this might help some one

@David Moreno Cantero 2014-07-22 17:16:08

I make all of the solutions in here with no result, so i look in another place and i found a way to trick the IDE, so you have to put a line in the Mainfest to make the Gradle use a different one, the one that you put on build.gradle the line is:

<uses-sdk tools:node="replace" />

just it, and it work.

I hope it helps.

@seb 2014-08-24 16:19:30

remember to add: xmlns:tools="" in the <manifest>-tag

@Leonardo Cardoso 2014-07-02 01:50:59

Adding to the correct answers above, the problem still might occur due to library nesting. In this case, try as the example below:

compile ''
compile ('com.github.chrisbanes.actionbarpulltorefresh:extra-abs:+') { // example
    exclude group: '', module:'support-v4'
    exclude group: '', module:'appcompat-v7'

@Rizwan Rasheed 2017-06-18 21:36:07

this solution work for me thanks

@IgorGanapolsky 2014-07-07 15:52:16

Try deleting the build folder(s) in your project and resync your gradle project to rebuild it. Also, like others have said in this post - instead of doing something like this:

compile ''

do this:

compile ''

@Bhargav Jhaveri 2014-07-05 21:17:15

In the build.gradle file, It was by default compile '' so when you build the gradle projecit would consider, because of the recent L developer preview release.

Make changes in the following line and it will resolve the issue. Change

compile '' 


compile ''

Similarly when using v7-appcompat support library, make the change from

compile ''


compile ''.

@Gaurav Arora 2014-06-27 12:48:56

Solution 1:

Change uses-sdk to <uses-sdk tools:node="replace" /> and add xmlns:tools="" in AndroidManifest.xml

 <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android=""
    <uses-sdk tools:node="replace" />

Make sure you use gradle 0.11 and above to use Manifest merger.

Solution 2:

  • Change compile '' to compile '' in build.gradle. This will prevent gradle from using v4:21.0.0 that requires version L.

  • However, if your any of your external dependencies uses the same. You will probably have to wait for them to update the same.

Solution 3:

  • Remove/Comment <version>21.0.0-rc1</version> in your file <android-sdk>/extras/android/m2repository/com/android/support-v4/maven-metadata.xml

  • Repeat the same for support-v7

@eipipuz 2014-07-01 21:24:54

In my case I also had to remove the appcompat-v7 equivalent.

@Xavier Ducrohet 2014-07-02 18:38:03

Yes do not provide solution 2 as an option. Proper dependency management (using the right version), or using resolution strategy is the right solution. Editing the maven repo is only delaying the problem until a new repo is released.

@Climbatize 2014-08-10 19:00:24

Solution 1 + 3 saved my life :)

@Tejasvi Hegde 2014-11-11 15:10:19

First option works! I would suggest you to add some details about why this to be done.

@Cristiana Chavez 2014-07-03 11:27:45

I solved the problem by editing the line below in build.gradle and it works! :-)

adding version 20.+'


 dependencies {
        compile ''


dependencies {
    compile ''

@Azurespot 2014-07-22 07:10:29

I can't believe it. None of the other answers above worked for me, except this one. Thank you!!! Note, I had to change both my v4 and v7 support files to the :20.+.

@koesclem 2014-07-02 13:37:19

The problem still arises with transitive dependencies. Gradle offers a way to force the usage of a specific version of a dependency.

For example you can add something like:

configurations.all {
    resolutionStrategy {
        force ''
        force ''

to your build.gradle.

If you want to learn more about gradle resolution strategies refer to this guide

I found this while reading the corresponding issue which I will link here

@Sloy 2014-08-03 10:43:31

Thanks! Easier than putting exclude in every dependency :)

@Aracem 2014-07-01 13:52:34

You have to configure all the supports and appcompat libraries with version 19.+

If the recommendation of leave the support library with the 19.+ version doesn't works you can try the next tip in your AndroidManifest file.

First add this code:


And then, at the application level (not inside application!)

<uses-sdk tools:node="replace" />

@CoolMind 2014-07-01 08:01:19

Don't forget, you should edit build.gradle in 'app' subfolder of your project, not in project's folder. I've lost a working day trying to solve a problem with version "L".

@LemonGentry 2014-06-28 06:58:37

Here's the new bug filed for this btw

Assuming you are using the Support Repository, the workaround is to comment or remove the line

21.0.0-rc1 in the local Maven repo listing file at /extras/android/m2repository/com/android/support-v4/maven-metadata.xml

@Igor Kostenko 2014-06-27 12:55:09

You need to remove from build.gradle compile ''

@murtuza 2014-06-26 23:15:50

Also, in case you are importing the appcompat-v7 library make sure you tag a version number at the end of it like so:

compile ''
compile ''

After only changing the support-v4 version, I still received the error:

Manifest merger failed : uses-sdk:minSdkVersion 15 cannot be smaller than version L declared in library

It was a bit confusing because it looks like v4 is still the problem, but, in fact, restricting the appcompat v7 version fixed the problem.

@RoundSparrow hilltx 2014-06-27 01:54:31

Good catch! none of my v7 had the version on them either.

@Defuera 2014-07-01 21:41:08

and also the same thing for support v13 )

@Azurespot 2014-07-06 07:48:22

I had a mismatch of appcompat_v7 too, buildToolsVersion '20.0.0' in my android{} and compile '' in my dependencies {} was not the same, so I made them the same (as shown here).

@sud007 2015-04-22 10:58:35

It is a bad practice to use + identifier for future versions. Specify the exact version. I suggest to update the '' to this '' or which is the latest one. If you still face issues try updating support library from SDK manager.

Related Questions

Sponsored Content

42 Answered Questions

[SOLVED] Automatically accept all SDK licences

2 Answered Questions

[SOLVED] Android debug error: "Execution failed for task" and "Manifest merger failed"

  • 2014-09-22 10:15:11
  • user225711
  • 54 View
  • 0 Score
  • 2 Answer
  • Tags:   android

6 Answered Questions

[SOLVED] Manifest merger failed : uses-sdk:minSdkVersion 8 cannot be smaller

  • 2014-07-13 01:36:56
  • user1438799
  • 71095 View
  • 33 Score
  • 6 Answer
  • Tags:   java android

2 Answered Questions

[SOLVED] Manifest merger failed : uses-sdk:minSdkVersion 11

1 Answered Questions

[SOLVED] Android Studio: Manifest merger failed : uses-sdk:minSdkVersion 8

Sponsored Content