将AndroidStudio更新为3.0报错?

内容来源于 Stack Overflow,并遵循CC BY-SA 3.0许可协议进行翻译与使用

  • 回答 (2)
  • 关注 (0)
  • 查看 (840)
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 /media/nikhilesh/App/src/main/res/drawable/ic_add_black_24dp.xml : Can't process attribute android:fillColor="@color/green": 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.

怎么解决这个问题?

提问于
用户回答回答于

只需将这一行添加到build.gradle(Module:app)的defaultConfig中即可。

vectorDrawables.useSupportLibrary = true

以及同一个build.gradle

compile 'com.android.support:appcompat-v7:23.1.0'
用户回答回答于

可以在应用程序build.gradle的默认配置中添加以下行:

defaultConfig{
   vectorDrawables.useSupportLibrary = true
}

此外还需要添加此依赖项:

dependencies {
    compile 'com.android.support:appcompat-v7:26.1.0'
}

扫码关注云+社区

领取腾讯云代金券