References to other resources are not supported by build-time PNG generation
To support API SDK < 24 add the following line to your app build.gradle
inside the android
block:
defaultConfig { vectorDrawables.useSupportLibrary = true}
If your minSdkVersion is 24 or higher, then your issue will be resolved on its own, because VectorDrawables have full support starting with this API.
See Android Developers: Vector Drawables Backward Compatibility Solution for details.
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:
- Android 5.0 (API level 21) was the first version to officially support vector drawables.
- If you use minSdkVersion lower than 20, there are two solutions for vector drawable
- Android Studio's Vector Asset Studio generate PNG. Please take a look Android Studio document. But, references to other resources are not supported by build-time PNG generation.
- Use support library
- Or, use 21 or above for minSdkVersion
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'}