使用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
相关推荐
androidwork2 小时前
Android LinearLayout、FrameLayout、RelativeLayout、ConstraintLayout大混战
android·java·kotlin·androidx
每次的天空2 小时前
Android第十三次面试总结基础
android·面试·职场和发展
wu_android2 小时前
Android 相对布局管理器(RelativeLayout)
android
李斯维4 小时前
循序渐进 Android Binder(二):传递自定义对象和 AIDL 回调
android·java·android studio
androidwork4 小时前
OkHttp 3.0源码解析:从设计理念到核心实现
android·java·okhttp·kotlin
像风一样自由5 小时前
【001】frida API分类 总览
android·frida
casual_clover5 小时前
Android 之 kotlin 语言学习笔记四(Android KTX)
android·学习·kotlin
移动开发者1号7 小时前
Android 大文件分块上传实战:突破表单数据限制的完整方案
android·java·kotlin
移动开发者1号7 小时前
单线程模型中消息机制解析
android·kotlin
每次的天空9 小时前
Android第十五次面试总结(第三方组件和adb命令)
android