AndroidStudio 3.0 / Android Gradle plugin 3.0
I've been able to work around this by doing the following:
This way the compiler will work
I think you are using android:fillColor="@color/image_button_disabled"
this code for vector drawable.
// image_button_disabled.xml
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/circular_image_color_pressed" android:state_pressed="true" />
<item android:color="@color/circular_image_color_normal" />
</selector>
It's not supported.
Just replace it with android:fillColor="#c4ca5e"
To add up to @mwa91 answer.
In case you need dynamic theming of drawable, but you don't have time to update your layouts and go with @mwa91 answer and change all android:src="@drawable/..."
attributes to app:srcCompat="@drawable/..."
, you can always use hex color value in drawable and then later tint the drawable in ImageView:
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/your_drawable"
android:tint="@color/image_button_disabled"
/>
you need to use the hex code directly not referring to a resource.
<vector
<path
android:fillColor="#FFF"/></vector>
Little bit more context for this error:
For support library, add a statement to your build.gradle file:
android {
defaultConfig {
vectorDrawables.useSupportLibrary = true
}
}
dependencies {
compile 'com.android.support:appcompat-v7:23.2.0'
}
If your minSdkVersion is 21 you can disable the generation of PNG by adding this line:
// set to an empty list to disable the feature
vectorDrawables.generatedDensities = []
Removing this line will still generate the PNGs.
Source: http://google.github.io/android-gradle-dsl/current/com.android.build.gradle.internal.dsl.VectorDrawablesOptions.html