使用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
相关推荐
木子予彤4 分钟前
直破 Android 17 大屏困局:Navigation 3 架构深度解析
android·android jetpack
用户41659673693557 分钟前
记一次 Compose 文本排版填坑:为什么阿拉伯文案明明空间足够却强行换行?
android
九天轩辕15 分钟前
Android CI/CD 编译 AIDL 报错分析与解决
android·java·ci/cd
人民的石头29 分钟前
android AI 规则匹配引擎接入
android
小手智联老徐1 小时前
Windows 下 ADB 无线调试与系统级操作指南
android·windows·adb
叶羽西1 小时前
Android15 Media框架JNI Interface调试
android
spencer_tseng1 小时前
anti-screenshot (Android + iOS)
android·ios
程序员Android1 小时前
Android 相机MFNR 拍照trace 分析
android·数码相机
2501_915918411 小时前
基于Mach-O文件的动态库与静态库归属方案及API扫描实践
android·ios·小程序·https·uni-app·iphone·webview
踏雪羽翼1 小时前
android 实现google 订阅支付
android·支付·订阅·google订阅·谷歌支付