Skip to content Skip to sidebar Skip to footer

Android Studio 3.0 Canary 6 A Failure Occurred While Executing Com.android.build.gradle.tasks.MergeResources$FileGenerationWorkAction

All was fine until i updated the android studio to Canary 6, When i rebuild or clean or whatever with project it's throw : A failure occurred while executing com.android.build.gr

Solution 1:

The advantage of adding a multi-density vector graphic is to use a vector instead of a bitmap to reduce the size of the APK because the size of the same file can be adjusted for different screen densities without loss off image quality. For older versions of Android that don't support vector drawables, Vector Asset Studio can, at build time, turn your vector drawables into different bitmap sizes for each screen density

 classpath 'com.android.tools.build:gradle:3.0.0-alpha8

build.gradle

android {
  defaultConfig {
    vectorDrawables.useSupportLibrary = true
  }
}

Solution 2:

Adding vectorDrawables.useSupportLibrary = true to defaultConfig of build.gradle(Module) worked for me. :)


Solution 3:

I had the same issue. There were two ways to fix my case:

  1. Adding vectorDrawables.useSupportLibrary = true
  2. In my drawable vector xml files there were links to @color:

    <path
        android:fillColor="@color/white"
        ...
    

    I replaced with

    <path
        android:fillColor="#fff"
        ...
    

    and the problem disappeared.


Solution 4:

There is a lot problems with android studio canary 6, the best way to solve that is to change your class path in the dependencies in your gradle to

classpath 'com.android.tools.build:gradle:2.3.3' 

Solution 5:

Just add vectorDrawables.useSupportLibrary = true in defaultConfig, it's work fine for me

defaultConfig {
        vectorDrawables.useSupportLibrary = true
}

Post a Comment for "Android Studio 3.0 Canary 6 A Failure Occurred While Executing Com.android.build.gradle.tasks.MergeResources$FileGenerationWorkAction"