Skip to content
Latchkey

Android "Failed to find Build Tools revision X" in CI

The Android Gradle plugin resolves a specific Build Tools revision to run aapt2, d8, and zipalign. When that revision is not installed in the runner SDK, the build fails before compilation with a request to install it.

What this error means

The build fails with "Failed to find Build Tools revision 34.0.0" or "Installed Build Tools revision X is corrupted. Remove and install again."

Android
> Failed to find Build Tools revision 34.0.0

Common causes

The required Build Tools revision is not installed

The project pins buildToolsVersion (or AGP requires a default) that the runner SDK does not have.

A corrupted Build Tools install

A partially downloaded revision is present but corrupt, so the plugin treats it as missing.

How to fix it

Install the required revision

  1. Install the exact Build Tools revision the build needs with sdkmanager.
  2. Accept SDK licenses if prompted.
  3. Re-run the build.
Terminal
sdkmanager "build-tools;34.0.0"

Reinstall a corrupted revision

If the revision exists but is reported corrupt, remove and reinstall it.

Terminal
sdkmanager --uninstall "build-tools;34.0.0"
sdkmanager "build-tools;34.0.0"

How to prevent it

  • Install the Build Tools revision the project pins on the runner.
  • Cache the SDK so the revision is not refetched every run.
  • Reinstall any revision reported corrupt rather than ignoring it.

Related guides

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