使用AndResGuard报错:copy res file not in resources.arsc file:Ezi.xml

Android使用AndResGuard进行资源混淆,压缩。

源码地址:GitHub - shwenzhang/AndResGuard: proguard resource for Android by wechat team

集成完成后编译过程中出现如下错误:

复制代码
14:57:05 copy res file not in resources.arsc file:IUk.xml
14:57:05 copy res file not in resources.arsc file:kLL.png
14:57:05 copy res file not in resources.arsc file:nVK.xml
14:57:05 copy res file not in resources.arsc file:Ph3.png
14:57:05 copy res file not in resources.arsc file:EsW.xml

...省略N行

复制代码
14:57:12 do not have the compress data path =r/MfA.xml in resource.asrc
14:57:12 do not have the compress data path =r/ThH.xml in resource.asrc
14:57:12 do not have the compress data path =r/VqH.xml in resource.asrc
14:57:12 do not have the compress data path =r/37u.xml in resource.asrc

...省略N行

此时请检查你的 com.android.tools.build:gradle:4.2.2

如果版本号是4.2.2或以上版本,那出现该问题就是由于和gradle的资源混淆冲突了,二者选其一即可,那么如何关闭gradle的资源混淆呢?

在gradle.properties中添加如下代码即可

复制代码
#禁止自带的资源混淆
android.enableResourceOptimizations=false
相关推荐
Grackers1 小时前
Android Perfetto 系列 9:CPU 信息解读
android
零陵上将军_xdr2 小时前
MySQL 事务写入流程详解
android·数据库·mysql
菜鸟国国2 小时前
Jetpack Compose 副作用完全解析(初学者必看,超详细)
android
2501_915921435 小时前
苹果iOS应用开发上架与推广完整教程
android·ios·小程序·https·uni-app·iphone·webview
jian110585 小时前
Android studio gradle和插件的版本设置
android·ide·android studio
idolao5 小时前
Android Studio 2022安装与汉化教程 Windows版:解压+管理员运行+自定义路径+SDK配置+中文插件指南
android·windows·android studio
2501_915106326 小时前
HTTP和HTTPS协议工作原理及安全性全面解析
android·ios·小程序·https·uni-app·iphone·webview
古阙月6 小时前
嘉立创PCB设计初级总结
android·pcb工艺
Dream of maid6 小时前
Mysql(7)子查询
android·数据库·mysql