Android studio 3.0 Canary 6 A failure occurred while executing com.android.build.gradle.tasks.MergeResources$FileGenerationWorkAction

后端 未结 7 1669
情书的邮戳
情书的邮戳 2021-02-13 04:56

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 exec

相关标签:
7条回答
  • 2021-02-13 05:26

    The issue is with build gradle 3.1.4. Downgrade to 3.1.3 and you should be good to go

    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.3'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
    
    0 讨论(0)
  • 2021-02-13 05:27

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

    0 讨论(0)
  • 2021-02-13 05:30

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

    defaultConfig {
            vectorDrawables.useSupportLibrary = true
    }
    
    0 讨论(0)
  • 2021-02-13 05:33

    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
      }
    }
    
    0 讨论(0)
  • 2021-02-13 05:35

    add this to your build.gradle under defaultConfig

    vectorDrawables.useSupportLibrary = true .

    this will solve your problem.

    0 讨论(0)
  • 2021-02-13 05:36

    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' 
    
    0 讨论(0)
提交回复
热议问题