使用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
相关推荐
鸿蒙布道师15 分钟前
鸿蒙NEXT开发资源工具类(ArkTs)
android·ios·华为·harmonyos·arkts·鸿蒙系统·huawei
V少年26 分钟前
深入浅出安卓字节码插装
android
V少年27 分钟前
深入浅出Hook
android
V少年28 分钟前
深入浅出讲解安卓PMS
android
人生游戏牛马NPC1号2 小时前
学习Android(一)
android·kotlin
_一条咸鱼_2 小时前
深入剖析 Android Hilt 的编译期处理模块(七)
android·kotlin·android jetpack
WWWWW2 小时前
理解VSync-2-app,appsf sf注册回调
android·源码阅读
小趴菜82273 小时前
安卓Kotlin接入高德定位和地图SDK
android
清霜之辰3 小时前
详解 kotlin 相对 Java 特有的关键字及使用
android·java·kotlin