0

I can getting the following error: Error:Execution failed for task ':app:processDebugManifest'.

Manifest merger failed : uses-sdk:minSdkVersion 15 cannot be different than version L declared in library .../com.android.support/recyclerview-v7/21.0.0-rc1/AndroidManifest.xml

Below is my build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 21
    buildToolsVersion "21.1.1"

    defaultConfig {
        minSdkVersion 15
        targetSdkVersion 20
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:recyclerview-v7:21.0.0-rc1'
    compile 'com.android.support:cardview-v7:21.0.0-rc1'
    ...

}

Using

<uses-sdk
    tools:node="replace" />

does not work anymore.

I have looked at this. The solution suggested place following code in gradle.build

android.applicationVariants.all { variant ->
variant.processResources.manifestFile = file('src/main/AndroidManifest.xml')
variant.processManifest.enabled=false }

But I get error

Error:(21, 0) Could not find property 'processResources' on com.android.build.gradle.internal.api.ApplicationVariantImpl_Decorated@dac7b2d.

No matter where I place the code in gradle.build

Community
  • 1
  • 1
paradite
  • 6,238
  • 3
  • 40
  • 58

1 Answers1

1

Replace:

compile 'com.android.support:recyclerview-v7:21.0.0-rc1'
compile 'com.android.support:cardview-v7:21.0.0-rc1'

with:

compile 'com.android.support:recyclerview-v7:21.0.0'
compile 'com.android.support:cardview-v7:21.0.0'

to use the production release versions of those libraries, instead of the L-only preview versions. They will work back to API Level 7.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • I get `Error:Failed to find: com.android.support:cardview-v7:21.0.0`. Does this mean I need to update the SDK? – paradite Dec 09 '14 at 15:45
  • 1
    @paradite: It would appear that your "Android Repository" is out of date -- get the latest from your SDK Manager. – CommonsWare Dec 09 '14 at 15:46
  • Thanks. It works on lower SDK now after updating from SDK manager. – paradite Dec 09 '14 at 16:19
  • 1
    there are newer version btw: `compile 'com.android.support:cardview-v7:21.0.2'` `compile 'com.android.support:recyclerview-v7:21.0.2'` – Daniel Kutik Dec 09 '14 at 16:32