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 1413
慢半拍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:11

    Thanks David for your answer!

    I had to change

    compile 'com.android.support:support-v13:+'
    

    To:

    compile 'com.android.support:support-v13:20.+'
    

    And everything work perfect now.

    0 讨论(0)
  • 2020-12-04 18:11

    Just in addition: The other answers here did not fix the problem for me, but I found an alternate way to fix the android-l problem on Android Studio 0.8.0. After I did change the dependencies in the build.gradle, the problem sadly kept occuring, that the code would say OLD_SKD. I'm using a Galaxy S2.

    Apart from changing all things to :19+:

    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        compile 'com.android.support:appcompat-v7:19+'
        compile 'com.android.support:support-v4:19+'
        compile 'com.google.android.gms:play-services:+'
        compile 'com.android.support:mediarouter-v7:19+'
    }
    

    It still would not work, so I had to move back everywhere possible:

    android {
        compileSdkVersion 19
        buildToolsVersion '19.1'
        defaultConfig {
            minSdkVersion 11
            targetSdkVersion 19
            versionCode 1
            versionName '1.0'
        }
    

    Now the app works again on the phone. I should probably get a new mobile, but for now, I hope this may help someone.

    0 讨论(0)
  • 2020-12-04 18:18

    The answer stated here may not work properly, as it will make your app only work for Android L.

    In order to conserve the backward compatibility with older Android OS versions, change the gradle dependecy

    From:

    compile 'com.android.support:appcompat-v7:+'
    

    To:

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

    Note that the error complains about com.android.support:appcompat-v7:21.0.0-rc1, the reason for that is that using appcompat-v7:+ will tell gradle to import the latest dependency of the appcompat-v7 library, unfortunately this latest version is only working for Android L, so we have to point to a previous version.

    Hopefully Google will fix this in the near future.

    0 讨论(0)
  • 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"
            }
    }
    
    0 讨论(0)
  • 2020-12-04 18:23

    The way that worked for me was to install the Android Studio Beta (Not Preview Release, the Beta was launched today as part of IO).

    Uninstall the preview release and install the Beta and open your project. It will ask you to use project SDK or Studio SDK, use Android Studio's SDK.

    Go to your projects local.properties file and where you have sdk.dir ensure that any backslashes () are doubled up .e.g. \.

    Go to Project Structure > SDK and ensure this pointing to the Android SDK on my Pc it was C:\Program Files(x86)\Android\android-studio\SDK.

    Then in your projects and any libraries you have build.gradle files where you have

    compile 'com.android.support:support-v4 Change it to compile 'com.android.support:support-v4:20+

    Resync the gradle files and all fixed

    0 讨论(0)
  • 2020-12-04 18:32

    To force working with a working version Just change the gradle dependencies like this:

    dependencies {
        compile 'com.android.support:gridlayout-v7:19.0.1'
        compile 'com.android.support:appcompat-v7:19+'
        ...
    }
    

    was:

    compile 'com.android.support:appcompat-v7:+'
    

    N.B.

    I updated Tools & Extras in the SDK manager.

    after the project was broken I fixed it as shown above.

    For now I do not update android L & 4.4W (enough bugs for today :-( )

    0 讨论(0)
提交回复
热议问题