生成时PNG生成不支持对其他资源的引用 [英] References to other resources are not supported by build-time PNG generation

查看:82
本文介绍了生成时PNG生成不支持对其他资源的引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

AndroidStudio 3.0/Android Gradle插件3.0

AndroidStudio 3.0 / Android Gradle plugin 3.0

<vector>
  <path android:fillColor="@color/image_button_disabled"/>
</vector>

我收到此错误:

生成时PNG生成不支持

对其他资源的引用

references to other resources are not supported by build-time PNG generation

是否有可能解决该问题,或者它是否已过时?

Will it be possible to resolve it or is it a deprecated solution?

推荐答案

要支持API SDK< 24将以下行添加到您的应用程序build.gradle:

To support API SDK < 24 add the following line to your app build.gradle:

defaultConfig{
   vectorDrawables.useSupportLibrary = true
}

如果您的minSdkVersion为24或更高,则您的问题将自行解决,因为VectorDrawables从此API开始完全支持.

If your minSdkVersion is 24 or higher, then your issue will be resolved on its own, because VectorDrawables have full support starting with this API.

请参见 Android开发者: Vector Drawables向后兼容解决方案以获取详细信息.

See Android Developers: Vector Drawables Backward Compatibility Solution for details.

这篇关于生成时PNG生成不支持对其他资源的引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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