将Android Studio更新到3.0并解决了这个问题 [英] Updated Android Studio to 3.0 and getting this issue

查看:258
本文介绍了将Android Studio更新到3.0并解决了这个问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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.

我们如何解决这个问题?

How can we solve this?

推荐答案

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

You can add the following line inside your default config of your app build.gradle:

defaultConfig{
   vectorDrawables.useSupportLibrary = true
}

如果还没有,则还需要添加此依赖项

you also need to add this dependency if you didn't already

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

更新:

从Gradle 3.4开始,compile配置为已弃用,应该用implementation代替:

Since Gradle 3.4 the compile configuration is deprecated and should be replaced by implementation:

dependencies {
    implementation 'com.android.support:appcompat-v7:27.1.1'
}

这篇关于将Android Studio更新到3.0并解决了这个问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆