Matched signals
- FAILURE: Build failed with an exception
- What went wrong:
- Could not resolve
- Could not download
- Execution failed for task
- Gradle build daemon
- Could not GET
- compileSdkVersion
Gradle build failure
What this failure means
Gradle exited with a non-zero status, indicating one or more tasks failed. The FAILURE: block in the output identifies the first task that failed and the root cause.
Symptoms
Faultline looks for one or more of these log fragments:
FAILURE: Build failed with an exception
What went wrong:
Could not resolve
Could not download
Execution failed for task
Gradle build daemon
Could not GET
compileSdkVersion
Diagnosis
Gradle exited with a non-zero status, indicating one or more tasks failed. The FAILURE: block in the output identifies the first task that failed and the root cause.
Fix steps
- Read the
What went wrong:block. It usually contains the direct cause and file location. - For
Could not resolve: check the repository URL and any private repo credentials. - For
Execution failed for task ':compileJava': fix the Java or Kotlin compilation errors listed below. - Run
./gradlew <task> --stacktracelocally for the full exception chain. - For daemon issues, run
./gradlew --no-daemononce to rule out cached state.
Validation
./gradlew build --stacktracecompletes successfully.- The CI build step exits zero without repeating the original
FAILURE:block.
Why it matters
Gradle failures can stem from dependency resolution errors, Android SDK drift, wrapper incompatibility, or a failing compile/test task. Because Gradle is often the outer build orchestrator, the first failure block is the shortest path to the real root cause.
Prevention
- Cache
~/.gradle/cachesbetween CI runs to avoid repeated dependency downloads. - Pin the Gradle wrapper version in
gradle/wrapper/gradle-wrapper.properties. - Enable
--build-cachein CI to reuse task outputs across runs.
Try it locally
./gradlew build --stacktrace
./gradlew build --stacktrace
How Faultline detects it
Use faultline explain gradle-build to see the full playbook.
faultline analyze build.log
faultline explain gradle-build
Generated from playbooks/bundled/log/build/gradle-build.yaml. Do not edit directly.