android 3.0 升级之后 SVG vector报错 以及解决办法

刚升级万Android studio 3  编译之后得到报错代码

: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 H:\workspace\MyTaxi\app\src\main\res\drawable\ic_logo.xml : Can't process attribute android:strokeColor="@color/logoColor": 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.


网上搜索了很多关于这个报错资料,花费了很多时间,但是没有找到解决解决方法。最后猜测应该是svg的兼容性出错了,所以解决方法就是增加vector的兼容性。

解决方法:

在module的gradle文件中,在

android {
defaultConfig {
//。。。。。 这这添加
vectorDrawables.useSupportLibrary = true
}
}

本人实测解决问题。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值