Skip to content
Latchkey

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 failed

Common 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

  1. Scroll up to the Android resource linking failed block for the exact file and line.
  2. Fix the missing reference or malformed resource it names.
shell
./gradlew :app:processDebugResources --stacktrace

Raise 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

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →