Failure [INSTALL_FAILED_OLDER_SDK] error from Manifest merger failed : uses-sdk:minSdkVersion 15 cannot be smaller than version L

拥有回忆 提交于 2019-12-11 14:54:56

问题


Recently I was receiving this error.

Manifest merger failed : uses-sdk:minSdkVersion 11 cannot be smaller than version L

So I changed it to

  minSdkVersion 'L'

And then I got this error

Failure [INSTALL_FAILED_OLDER_SDK]

So I guess I did not resolve the first error correctly.

I'm not exactly sure what to do. I've been following this:

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

Manifest merger failed : uses-sdk:minSdkVersion 14

http://www.reddit.com/r/androiddev/comments/297xli/howto_use_the_v21_support_libs_on_older_versions/

but strangely no luck.

This is what I have:

   apply plugin: 'android'

android {
    compileSdkVersion 21
    buildToolsVersion '20.0.0'
    defaultConfig {
        applicationId 'com.spicycurryman.getdisciplined10.app'
        minSdkVersion 15
        targetSdkVersion 21
        versionCode 1
        versionName '1.0'
    }


    buildTypes {
        debug {
            applicationIdSuffix '.dev'
        }
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
    }
}

dependencies {

    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:21.+'
    compile project(':seekArc_library')
}

EDIT: This is what I am using now

New build:

apply plugin: 'android'

android {
    compileSdkVersion 19
    buildToolsVersion '19.1.0'
    defaultConfig {
        applicationId 'com.spicycurryman.getdisciplined10.app'
        minSdkVersion 14
        targetSdkVersion 19
        versionCode 1
        versionName '1.0'
    }


    buildTypes {
        debug {
            applicationIdSuffix '.dev'
        }
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
    }
}
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:19.1.+'
    compile 'com.android.support:support-v4:19.1.+'
    compile project(':seekArc_library')

}

Unfortunately this is not working as well. I am not sure why the specified version is not being compiled.


回答1:


It appears that the device or emulator where you are deploying the app is running a version of Android that is prior to "L". Either use the "L" emulator or change your "build.gradle" file to require a lower version (i.e. change the "targetSdkVersion" and "compileSdkVersion" to something lower).




回答2:


I found out that in order to force my compiler the compile the specified version I need to include the following:

configurations.all {
    resolutionStrategy {
        force 'com.android.support:support-v4:20.+'
        force 'com.android.support:appcompat-v7:20.+'
    }
}

Seems like a bug with the new Android L preview update.



来源:https://stackoverflow.com/questions/24546249/failure-install-failed-older-sdk-error-from-manifest-merger-failed-uses-sdk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!