Manifest merger failed : uses-sdk:minSdkVersion 10 cannot be smaller than version L declared in library com.android.support:appcompat-v7:21.0.0-rc1

Bogdan Zurac picture Bogdan Zurac · Jun 26, 2014 · Viewed 49.7k times · Source

Got the above error after downloading L preview release version in Android Studio, when my project had minSdkVersion 19.

Furthermore, when setting mindSdkVersion as below:

defaultConfig {
....
          minSdkVersion 'L'
....
    }

I get dozens of errors as below, regarding resources from AppCompat-v7-21 :

/home/user/workspace/project/build/intermediates/exploded-aar/com.android.support/appcompat-v7/21.0.0-rc1/res/values-v21/values.xml
Error:Error retrieving parent for item: No resource found that matches the given name '@android:TextAppearance.Material.SearchResult.Subtitle'.

So I have 2 questions:

  1. Why does AS complain about minSdkVersion ? I presume because AppCompat-v7 21 supports only L release; but why ? Also, will it support only L release when it is going to be officially released in autumn too ? Because that would be a problem... Or is it just a temporary restriction in order for apps not be be pushed to Play Store, as specified in the Google I/O 2014 Keynote ?
  2. Why does AppCompat-v7 21 complain about those errors, as I already set mindSdkVersion to L ?

Answer

Bogdan Zurac picture Bogdan Zurac · Jun 26, 2014
compileSdkVersion 'android-L'

BOOM. Done.

LAST EDIT: As of Android 5.0 release, this is no longer an issue, just target API level 21 directly.

Edit for clarity: Indeed as David_E specified below, this solution only works for L version, if you try to deploy the app on a device below L (ex <=4.4.4) it will complain of OLD_SDK. In order for the app to work pre-L you still need to use the old v20 support lib + app compat + targetVersionSdk and compileVersionSdk

dependencies {

        compile 'com.android.support:appcompat-v7:20.+'
        compile 'com.android.support:support-v4:20.+'
    }

    android {
        compileSdkVersion 20
        buildToolsVersion '20'

        defaultConfig {
            applicationId "com.example.application"
            minSdkVersion 10
            targetSdkVersion 20
            versionCode 1
            versionName "1.0"
        }
}