I Have build my app in android 6 without any error, but when I build my app in android 4.4.2 I get this error
This app has been built with an incorrect configuration. Please configure your build for VectorDrawableCompat.
and this is my gradle:
android {
compileSdkVersion 24
buildToolsVersion "23.0.0"
defaultConfig {
applicationId "com.faranegar.channel"
minSdkVersion 11
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
note: when I set compileSdkVersion 23, every thing is fine and there isn't any error.
This worked well for me
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.example.app"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
generatedDensities = []
}
// This is handled for you by the 2.0+ Gradle Plugin
aaptOptions {
additionalParameters "--no-version-vectors"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
Notice this in the above code:
// This is handled for you by the 2.0+ Gradle Plugin
aaptOptions {
additionalParameters "--no-version-vectors"
}
and
generatedDensities = []
UPDATE
If this generatedDensities = []
is showing deprecated, use the following instead.
vectorDrawables.generatedDensities = []
Hope it helps
This issue was alread reported here Issue 214182: appcompat-v7 24.0.0 is incompatible with rasterized vectors.
One of the developer mention:
What version of the Gradle plugin are you using?
As of v2.0 of the Gradle plugin, library resources are never rasterized so this should never happen.
The workaround for this is to update your Gradle by following this official link. Android Plugin for Gradle Release Notes.
buildscript {
...
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
}
}
if you are using rasterized vector drawables
for Gradle plugin 2.0+
android {
defaultConfig {
vectorDrawables.useSupportLibrary = true
...
}
}
for Gradle plugin before 2.0
android {
defaultConfig {
generatedDensities = []
...
}
aaptOptions {
additionalParameters "--no-version-vectors"
}
}
you should add appcompat-v7 23.2.0+ to your build.gradle.for me,i am using
compile 'com.android.support:appcompat-v7:23.4.0'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With