使用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
相关推荐
Pika6 小时前
深入浅出 Compose 测量机制
android·android jetpack·composer
木易 士心11 小时前
MPAndroidChart 用法解析和性能优化 - Kotlin & Java 双版本
android·java·kotlin
消失的旧时光-194311 小时前
Kotlin Flow 与“天然背压”(完整示例)
android·开发语言·kotlin
ClassOps11 小时前
Kotlin invoke 函数调用重载
android·开发语言·kotlin
努力学习的小廉12 小时前
初识MYSQL —— 数据类型
android·数据库·mysql
Lei活在当下16 小时前
【业务场景架构实战】7. 多代智能手表适配:Android APP 表盘编辑页的功能驱动设计
android·设计模式·架构
手机不死我是天子19 小时前
《Android 核心组件深度系列 · 第 2 篇 Service》
android
前行的小黑炭20 小时前
Compose页面切换的几种方式:Navigation、NavigationBar+HorizontalPager,会导致LaunchedEffect执行?
android·kotlin·app
前行的小黑炭20 小时前
Android :Comnpose各种副作用的使用
android·kotlin·app
BD_Marathon1 天前
【MySQL】函数
android·数据库·mysql