使用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
相关推荐
爱笑鱼1 小时前
Handler(一):post 之后,Runnable 到底在哪个线程执行?
android
木木子222 小时前
[特殊字符] 音乐播放器——状态驱动的多媒体控制
android·开发语言·华为·php·harmonyos
雨白2 小时前
C 语言基础:结构体、联合体与枚举
android
阿巴斯甜4 小时前
Android 代码混淆
android
apihz5 小时前
台风实时与历史详情查询免费 API 接口完整教程
android·开发语言·tcp/ip·dubbo·台风·天气预报
浪客川6 小时前
AOSP源码隐藏状态栏
android·aosp
没有了遇见7 小时前
AI Agent 是什么?—— 一文理解 LLM、Memory、Skills、Tools、MCP、Workflow,Context
android·前端·程序员
知行合一。。。7 小时前
LangChain--07--智能体、Agent的基本用法
android·数据库·langchain
御坂嘀喵7 小时前
Speed Tools:一套低侵入的 Android 插件化 + 动态换肤 + 字体切换框架
android·gitee
浮江雾7 小时前
Flutter第三节----Dart中的数据类型
android·开发语言·学习·flutter·入门·函数