Joacer Joacer - 2 years ago 94
Android Question

Error creating new Android project with Android Studio

I just created a new project Android with Android Studio and I have chosen the minimum SDK 9 (Gingerbread) and the activity

NavigationDrawer Activity
, once chosen and created the project I get the following error:

Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 9 cannot be smaller than version 14 declared in library [com.android.support:design:26.0.0-alpha1] C:\xxx\xxx\.android\build-cache\bd439271136a9bc6f4bc228104359605401bab70\output\AndroidManifest.xml
Suggestion: use tools:overrideLibrary="android.support.design" to force usage


And I have not touched anything or modified anything that has created the Android Studio itself and I have updated the SDK with the latest versions.

Any suggestion?

Gradle:

apply plugin: 'com.android.application'

android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "xx.xx.xx.seguros"
minSdkVersion 9
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support:design:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
}

Answer Source

What happening inside it is. The Library support design using the minimum SDK version 14. So you can't use this library if your app minimumSdk version lower than that.

You should use com.android.support:design:25.+ to support minSdkVersion 9.

If you use com.android.support:design:26.0.0-alpha1. You must use minSdkVersion 14

Update your gradle like this.

compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
    applicationId "xx.xx.xx.seguros"
    minSdkVersion 14      // Update it to 14
    targetSdkVersion 26
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

Hope it helps:)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download