0
votes

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.

2
Which APIs do you have installed? Are you running on an emulator or device? Which API is running on the emulator/device?Code-Apprentice
I have everything up to 21. Samsung Galaxy s4. I am trying to run 19Rohit Tigga
Also, please only include the current build.gradle file in your post. It is unclear why you have two here.Code-Apprentice
Since L is not available on a device, you will need to set your minSdkVersion to less than or equal to the one running on your device. To find out what version of Android you have, you can go to Apps->Settings->Phone. The Android version should be listed there.Code-Apprentice
I did that to 19 and I still get an error saying Manifest merger failed uses-sdk minSdkVersion 14 cannot be smaller than version L declared in library com.android. support -v4:21.0.0-rc1Rohit Tigga

2 Answers

0
votes

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).

0
votes

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.