Can't process attribute android:fillColor="@color/text_gray": references to other resources are not

来源:互联网 发布:雨露计划app软件 编辑:程序博客网 时间:2024/06/06 00:23

升级为android studio3.0,gradle升级为4.1,报错:

     A failure occurred while executing com.android.build.gradle.tasks.MergeResources$FileGenerationWorkAction  > Error while processing D:\Android\WeishuProjects\Zszy\app\src\main\res\drawable\ic_right_gray_24dp.xml : Can't process attribute android:fillColor="@color/text_gray": references to other resources are not supported by build-time PNG generation.

解决方法:

    使用Gradle Plugin 2.0以上:android {    defaultConfig {        vectorDrawables.useSupportLibrary = true    }}使用Gradle Plugin 2.0以下,Gradle Plugin 1.5以上:android {  defaultConfig {    // Stops the Gradle plugin’s automatic rasterization of vectors    generatedDensities = []  }  // Flag to tell aapt to keep the attribute ids around  aaptOptions {    additionalParameters "--no-version-vectors"  }}

你需要在项目的build.gradle脚本中,增加对Vector兼容性的支持

阅读全文
0 0