Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Flutter and app store releases

Android Gradle says an installed Build Tools revision is corrupted

ErrorThe build stops and reports that an installed Build Tools revision is corrupted and should be removed and installed again with the SDK Manager

Short answer

The Android Gradle plugin reports that the Build Tools revision in your SDK is corrupted and refuses to use it. Remove the revision and install it again with sdkmanager or the SDK Manager. If the revision is not needed, delete the buildToolsVersion line so the plugin uses its own default.

  • Applies to Android Gradle Plugin 8.x and 9.x, Gradle 8.x and 9.x, Android SDK Build-Tools 34 to 36, Android Studio current stable
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    List the revisions that exist in the SDK and look inside the one named in the error. A healthy revision holds many tools, a corrupted one is missing some or is nearly empty.

    ls "$ANDROID_HOME/build-tools"
    ls "$ANDROID_HOME/build-tools/31.0.0"
  2. 2Match what you see, then jump to its fix

    1. 1The error names a revision that is installed under the SDK build-tools folderThe installed Build Tools revision is damagedFix
    2. 2buildToolsVersion appears in build.gradle(.kts) or in a plugin's build file, and it names the revision in the errorThe project pins a revision that you do not needFix

What does the error look like?

  • The build stops and reports that an installed Build Tools revision is corrupted and should be removed and installed again with the SDK Manager

Cause 1 of 2

The installed Build Tools revision is damaged

1Check

Build Tools are installed to the build-tools folder of the SDK, one folder per revision. Reinstalling replaces the whole folder.

ls "$ANDROID_HOME/build-tools"
df -h "$ANDROID_HOME"

2Fix

Uninstall that revision, then install it again. With enough free disk space, this replaces the folder.

sdkmanager --uninstall "build-tools;31.0.0"
sdkmanager --install "build-tools;31.0.0"

3Verify

The folder has its tools again and the build moves past this error.

ls "$ANDROID_HOME/build-tools/31.0.0"
./gradlew assembleDebug

Confirmed by developer.android.com

Did this fix it?

Cause 2 of 2

The project pins a revision that you do not need

1Check

The buildToolsVersion property specifies the version of the SDK Build Tools to use when building the project, so a line there decides which revision the build opens.

grep -rn "buildToolsVersion" --include=*.gradle --include=*.kts .

2Fix

Set buildToolsVersion to a revision that is installed and works, and install that revision with sdkmanager if it is missing.

// module build.gradle.kts
android {
    buildToolsVersion = "36.0.0"   // a revision you have installed
}
# install it if needed
sdkmanager --install "build-tools;36.0.0"

3Verify

Sync the project and run a build. It uses the installed revision.

./gradlew assembleDebug

Confirmed by developer.android.com

Did this fix it?

How do I stop it coming back?

  • Do not close Android Studio or cancel SDK Manager while a package is downloading.
  • Keep free disk space above the size of the package before you start an install.
  • Pin buildToolsVersion only to a revision you have installed, and keep that line in one place.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Mobile apps

Gradle cannot find the Android SDK on this machine

FAILURE: Build failed with an exception. What went wrong: SDK location not found.

Gradle looks for the Android SDK in the sdk.dir line of android/local.properties and in the ANDROID_HOME environment variable, and found neither.

4 causes, each with a fix

Mobile apps

Android Studio cannot pair the phone over Wi-Fi

The Pair devices over Wi-Fi dialog lists no device

Wireless pairing needs the phone on Android 11 or higher and on the same Wi-Fi network as the computer, with current Platform-Tools.

4 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.