Android: Using SVG in res leads to error: “The file name must end with .xml or .

解决SVG图标合并资源错误
本文介绍了一种常见Android开发中遇到的问题,即在尝试合并包含SVG格式的图标资源时出现错误提示,指出文件名必须以.xml或.png结尾。文中提供了解决方案,通过在gradle.properties文件中添加特定配置来禁用资源验证。

错误类似:

:app:mergeDebugResources
:app:mergeDebugResources FAILED
/home/petergriffin/folder1/another-app/MyAwesome-App/app/src/main/res/drawable-hdpi/logo.svg
Error:Error: The file name must end with .xml or .png
Error:Execution failed for task ':app:mergeDebugResources'.
> /home/petergriffin/folder1/another-app/MyAwesome-App/app/src/main/res/drawable-hdpi/logo.svg: Error: The file name must end with .xml or .png
Information:BUILD FAILED

添加:
android.disableResourceValidation=true
至
gradle.properties 
该文件在settings.gradle附近
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值