1

My project was working perfectly fine until I upgraded my gradle to 4.1 in android studio and all hell broke loose.

I keep getting this error when I clean my project.

Error:Execution failed for task ':app:mergeDebugResources'. There were multiple failures while executing work items A failure occurred while executing com.android.build.gradle.tasks.MergeResources$FileGenerationWorkAction Error while processing C:\Users\daviestobialex\AndroidStudioProjects\ShopCentra\app\src\main\res\drawable\trapezoidal_bac.xml : Can't process attribute android:fillColor="@android:color/white": references to other resources are not supported by build-time PNG generation. See http://developer.android.com/tools/help/vector-asset-studio.html for details.

Apparently, it is throwing an error to a reference call that exists in my color.xml

DaviesTobi alex
  • 610
  • 1
  • 9
  • 34
  • have you tried removing the `fillColor` line from that `trapezoidal_bac.xml` vector drawable, or changing it to `#ffffff` instead of `@android:color/white`? My understanding with vector drawables is that you want to set those colors programatically anyway: https://stackoverflow.com/questions/32924986/change-fill-color-on-vector-asset-in-android-studio – emerssso Mar 20 '18 at 00:05
  • @emerssso I have tried using `#fff` but it does not work either – DaviesTobi alex Mar 20 '18 at 10:18

1 Answers1

2

Add this code to your app gradle

defaultConfig {
    vectorDrawables.useSupportLibrary = true // This is important for resolving you issue
}

dependencies {
    //noinspection GradleCompatible
    implementation 'com.android.support:appcompat-v7:27.1.1'
}
Eric Aya
  • 69,473
  • 35
  • 181
  • 253
Chauhan Ajay
  • 86
  • 1
  • 2
  • 14