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

后端 未结 6 1431
慢半拍i
慢半拍i 2020-12-04 18:11

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

Furthermore, when

6条回答
  •  佛祖请我去吃肉
    2020-12-04 18:21

    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"
            }
    }
    

提交回复
热议问题