android
build_error
ai_generated
true
Execution failed for task ':app:mergeDebugResources'. Resource compilation failed
ID: android/merge-debug-resources-failed
85%Fix Rate
88%Confidence
3Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 8 | active | — | — | — |
Root Cause
Android resource merge failed. Duplicate resources, invalid XML, or AAPT2 crash.
genericWorkarounds
-
92% success Check the full error output for specific resource conflict
Run: ./gradlew mergeDebugResources --stacktrace # shows exact conflicting resource
Sources: https://developer.android.com/build/
-
88% success Search for duplicate resource names across modules and libraries
grep -r 'resource_name' app/src/main/res/ # check for duplicates in values/, drawables, etc.
-
82% success Invalidate caches and restart (File > Invalidate Caches)
Android Studio: File > Invalidate Caches > Invalidate and Restart
Dead Ends
Common approaches that don't work:
-
Clean project repeatedly (Build > Clean)
65% fail
Clean removes build cache but does not fix the underlying resource conflict
-
Downgrade Gradle plugin version
72% fail
Masks the issue temporarily; the resource conflict still exists and will reappear