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

其他格式: JSON · Markdown 中文 · English
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.

generic

官方文档

https://www.guardsquare.com/manual/dexguard/configuration

解决方案

  1. 临时添加 '-dontobfuscate' 让 DexGuard 生成新映射文件,然后重新启用混淆并指定正确路径。
  2. 在 DexGuard 配置中设置映射文件输出路径:'-printmapping /path/to/mapping.txt' 并确保目录存在。
  3. 执行干净构建(./gradlew clean)并重新构建;如果输出目录可写,DexGuard 将创建新的映射文件。

无效尝试

常见但无效的做法:

  1. 80% 失败

    DexGuard expects a mapping file for consistent obfuscation; without it, obfuscation may fail or produce inconsistent results.

  2. 90% 失败

    This defeats the purpose of using DexGuard and may leave the app unprotected.