android
build_error
ai_generated
true
DexGuard: Obfuscation failed: Unable to read mapping file: /path/to/mapping.txt
ID: android/dexguard-obfuscation-missing-mapping
82%Fix Rate
86%Confidence
1Evidence
2024-01-05First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| DexGuard 9.3.0 | active | — | — | — |
| DexGuard 10.0.0 | active | — | — | — |
| AGP 8.2.0 | active | — | — | — |
| Gradle 8.5 | active | — | — | — |
Root Cause
DexGuard expects a previous mapping.txt file for incremental obfuscation, but the file is missing or path is incorrect.
generic中文
DexGuard 期望之前的 mapping.txt 文件用于增量混淆,但文件缺失或路径不正确。
Official Documentation
https://www.guardsquare.com/manual/dexguard/tools/retraceWorkarounds
-
85% success Add `-applymapping /path/to/valid/mapping.txt` in DexGuard config with the correct path from a previous successful build, or remove the line if incremental obfuscation is not needed.
Add `-applymapping /path/to/valid/mapping.txt` in DexGuard config with the correct path from a previous successful build, or remove the line if incremental obfuscation is not needed.
-
90% success Run a full clean build: `./gradlew clean assembleRelease` without incremental mapping to generate a new mapping.txt file.
Run a full clean build: `./gradlew clean assembleRelease` without incremental mapping to generate a new mapping.txt file.
中文步骤
Add `-applymapping /path/to/valid/mapping.txt` in DexGuard config with the correct path from a previous successful build, or remove the line if incremental obfuscation is not needed.
Run a full clean build: `./gradlew clean assembleRelease` without incremental mapping to generate a new mapping.txt file.
Dead Ends
Common approaches that don't work:
-
50% fail
Setting `-dontobfuscate` in DexGuard config disables obfuscation entirely, which defeats the purpose of using DexGuard for security.
-
90% fail
Copying a mapping.txt from a different build variant or version may cause class name conflicts and runtime crashes.
-
70% fail
Clearing the entire build cache with `./gradlew clean` deletes all intermediate files, including mapping.txt, worsening the issue.