Android "Execution failed for task :app:processDebugResources" in CI
Resource processing failed while compiling and linking app resources. The task wrapper is generic; the real cause is an AAPT2 error printed just above it.
What this error means
The build fails with Execution failed for task ":app:processDebugResources", usually preceded by AAPT2 errors about a specific resource or attribute.
gradle
Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction
> Android resource linking failedCommon causes
Invalid or missing resource
A referenced drawable, string, or attribute does not exist or is malformed, so resource linking fails.
compileSdk too low for an attribute
Using an attribute newer than the compileSdk causes resource linking to fail.
How to fix it
Read the AAPT2 error and fix the resource
- Scroll up to the
Android resource linking failedblock for the exact file and line. - Fix the missing reference or malformed resource it names.
shell
./gradlew :app:processDebugResources --stacktraceRaise compileSdk if an attribute is too new
Bump compileSdk to a version that defines the attribute you reference.
How to prevent it
- Build locally before pushing and keep compileSdk current with the APIs you use. Lint resource references in PR checks.
Related guides
Android "AAPT2 error: check logs for details" in CIFix the Android "AAPT2 error: check logs for details" message in CI by running with --stacktrace to surface t…
Android "Manifest merger failed" in CIFix the Android "Manifest merger failed" error in CI by resolving the conflicting attribute or library manife…
Android "minSdk/compileSdk mismatch" in CIFix Android minSdk and compileSdk mismatch errors in CI by raising compileSdk or your dependency requires a h…