A failure occurred while executing com.android.build.gradle.tasks.MergeResources$FileGenerationWorkA
2018-02-13 10:30
1761 查看
从GitHub上下载一个项目,导入Android studio之后报错。报错内容如下:
Error:There were multiple failures while executing work items
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 D:\androidProject\KuaiChuan-master\app\src\main\res\drawable\ic_storage_24dp.xml : Can't process attribute android:fillColor="@color/color_storage": 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.
> A failure occurred while executing com.android.build.gradle.tasks.MergeResources$FileGenerationWorkAction
> Error while processing D:\androidProject\KuaiChuan-master\app\src\main\res\drawable\ic_device_24dp.xml : Can't process attribute android:fillColor="@color/color_device": 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.
> A failure occurred while executing com.android.build.gradle.tasks.MergeResources$FileGenerationWorkAction
报错的截图如下:
这个bug解决起来也比较简单,在你的app的build.gradle的defaultConfig中添加如下的代码就可以了:
defaultConfig{
vectorDrawables.useSupportLibrary = true
} 添加完 vectorDrawables.useSupportLibrary = true这行代码之后,gradle一下就可以了。
如果本文对您有所帮助,麻烦点击一下左侧的点赞按钮,谢谢。
Error:There were multiple failures while executing work items
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 D:\androidProject\KuaiChuan-master\app\src\main\res\drawable\ic_storage_24dp.xml : Can't process attribute android:fillColor="@color/color_storage": 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.
> A failure occurred while executing com.android.build.gradle.tasks.MergeResources$FileGenerationWorkAction
> Error while processing D:\androidProject\KuaiChuan-master\app\src\main\res\drawable\ic_device_24dp.xml : Can't process attribute android:fillColor="@color/color_device": 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.
> A failure occurred while executing com.android.build.gradle.tasks.MergeResources$FileGenerationWorkAction
报错的截图如下:
这个bug解决起来也比较简单,在你的app的build.gradle的defaultConfig中添加如下的代码就可以了:
defaultConfig{
vectorDrawables.useSupportLibrary = true
} 添加完 vectorDrawables.useSupportLibrary = true这行代码之后,gradle一下就可以了。
如果本文对您有所帮助,麻烦点击一下左侧的点赞按钮,谢谢。
相关文章推荐
- Could not find property 'outputFile' on com.android.build.gradle.internal.api.ApplicationVariantImpl
- Android 解决 .build.gradle.tasks.factory.AndroidJavaCompile.setDependencyCacheDir(Ljava/io/File;)V
- 【我的Android进阶之旅】解决错误:No enum constant com.android.build.gradle.OptionalCompilationStep.FULL_APK
- Gradle build error, Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug
- Error:Could not find com.android.tools.build:gradle:2.3.3.
- No cached version of com.android.tools.build:gradle:2.0.0 available for offline mode.
- Could not find com.android.tools.build:gradle:1.3.0.
- Error:(7, 0) No such property: cruncherEnabled for class: com.android.build.gradle.internal.dsl.Aapt
- Error:Unable to find method 'com.android.build.gradle.api.BaseVariant.getOutputs()Ljava/util/List
- ionic无法下载'https://jcenter.bintray.com/com/android/tools/build/gradle/x.x.x/gradle-x.x.x.pom
- Error:Unable to find method 'com.android.build.gradle.internal.variant.BaseVariantData.getOutputs()L
- [已解决问题] An error occurred while automatically activating bundle com.android.ide.eclipse.adt
- [Android]解决org.gradle.api.internal.tasks.DefaultTaskInputs$TaskInputUnionFileCollection cannot be ca
- Unable to find method 'com.android.build.gradle.api.BaseVariant.getOutputs()Ljava/util/List;'
- Could not find com.android.tools.build:gradle:2.2.2.
- Could not find com.android.tools.build:gradle:3.0.0.
- An error occurred while automatically activating bundle com.android.ide.eclipse.adt
- Could not find com.android.tools.build:gradle:3.0.0-alpha1 in circle ci
- 解决 Could not find com.android.tools.build:gradle 问题
- 更新Android Studio版本出现Could not find com.android.tools.build:gradle:2.2.3