android
build_error
ai_generated
true
DexGuard:找不到映射文件:/path/to/mapping.txt。混淆可能失败。
DexGuard: Mapping file not found: /path/to/mapping.txt. Obfuscation may fail.
ID: android/dexguard-obfuscation-mapping-not-found
80%修复率
85%置信度
1证据数
2023-06-20首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| DexGuard 9.0 | active | — | — | — |
| DexGuard 10.0 | active | — | — | — |
| Android Gradle Plugin 7.4 | active | — | — | — |
| Android Gradle Plugin 8.0 | active | — | — | — |
根因分析
DexGuard 需要映射文件进行增量混淆,但由于清理构建或输出路径配置错误,该文件缺失。
English
DexGuard requires a mapping file for incremental obfuscation, but the file is missing due to a clean build or misconfigured output path.
官方文档
https://www.guardsquare.com/manual/dexguard/configuration解决方案
-
临时添加 '-dontobfuscate' 让 DexGuard 生成新映射文件,然后重新启用混淆并指定正确路径。
-
在 DexGuard 配置中设置映射文件输出路径:'-printmapping /path/to/mapping.txt' 并确保目录存在。
-
执行干净构建(./gradlew clean)并重新构建;如果输出目录可写,DexGuard 将创建新的映射文件。
无效尝试
常见但无效的做法:
-
80% 失败
DexGuard expects a mapping file for consistent obfuscation; without it, obfuscation may fail or produce inconsistent results.
-
90% 失败
This defeats the purpose of using DexGuard and may leave the app unprotected.