I just created a new Android project with Android Studio I have chosen the minimum SDK that is 9 (Gingerbread) and the activity that is a NavigationDrawer Activity
, once the project is chosen and created 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 Android Studio itself has created and I have also updated the SDK with the latest versions.
Any suggestion?
EDIT: 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'
}
I have found two solutions to eliminate this error, but I don't know which one will be the most correct
I) lowering the version, for this you have to modify the build.gradle using version 25 instead of 26 as follows:
II) using
tools:overrideLibrary
, for this you have to modify the manifest by adding the following:The library
com.android.support:design:26.+
requires a minimum of sdk 14 but your project the minimum sdk is 9. To work your project must be equal to or greater. Try looking for a compact library to be compatible with the sdk level of your project.Regarding the message:
It suggests that you have at least
minSdkVersion
version 14 defined, since an element, in this case the design support library ('com.android.support:design:26.+') requires this version as a minimum to work correctly, an option is change to:another option is to go back to version 25 that design support library ('com.android.support:design:25.0.0') can work with minSdkVersion 9
As the message suggests you can add in your AndroidManifest.xml
this to force it to work with API Level 9 but even if it works, you will notice strange behaviors on devices of that version or less than API 14, for example:
CardViews
with rounded corners on a 2.3 device it will display only squares, no elevation will be displayed.just enter the androidManifest.xml file and delete the line of code that you will find with the minskd version and put it there you are forcing it to work yes because yes