# DexGuard: Obfuscation failed: Unable to read mapping file: /path/to/mapping.txt

- **ID:** `android/dexguard-obfuscation-missing-mapping`
- **Domain:** android
- **Category:** build_error
- **Verification:** ai_generated
- **Fix Rate:** 82%

## Root Cause

DexGuard expects a previous mapping.txt file for incremental obfuscation, but the file is missing or path is incorrect.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| DexGuard 9.3.0 | active | — | — |
| DexGuard 10.0.0 | active | — | — |
| AGP 8.2.0 | active | — | — |
| Gradle 8.5 | active | — | — |

## Workarounds

1. **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.** (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.
   ```
2. **Run a full clean build: `./gradlew clean assembleRelease` without incremental mapping to generate a new mapping.txt file.** (90% success)
   ```
   Run a full clean build: `./gradlew clean assembleRelease` without incremental mapping to generate a new mapping.txt file.
   ```

## Dead Ends

- **** — Setting `-dontobfuscate` in DexGuard config disables obfuscation entirely, which defeats the purpose of using DexGuard for security. (50% fail)
- **** — Copying a mapping.txt from a different build variant or version may cause class name conflicts and runtime crashes. (90% fail)
- **** — Clearing the entire build cache with `./gradlew clean` deletes all intermediate files, including mapping.txt, worsening the issue. (70% fail)
