Android Studio 4.2.2 - Installed Build Tools revision 31.0.0 is corrupted. Remove and install again using the SDK Manager

14.9k Views Asked by At

I have a fresh install of the software, and whenever I try to run the build, it fails, giving me this error message.

Troubleshooting: I've already tried to uncheck 31.0.0 version in the SDK manager, and put in older stable versions, but every time I try to run it, it starts installing 31.0.0 again.

4

There are 4 best solutions below

0
ethanbankai On

You have to change the

buildToolsVersion "31.0.0"

to

buildToolsVersion "the-build-tool-version"

in all of your gradle files

0
AudioBubble On

There's something wrong with version 31.0.0.

Using the SDK tools section, click 'Show Package Details', uncheck 31.0.0 and check 30.0.3. Press apply.

This then uninstalls 31.0.0 and installs version 30.0.3. You should be able to apply those changes and then just change the buildToolsVersion "31.0.0" in your app gradle file to buildToolsVersion "30.0.3".

0
Phuc VR On

Work for me

File -> Project Structure -> Modules -> Change Build Tools Version from 31.0.0 to 30.0.3

0
Denis Micheal On

No need to downgrade. Renaming d8.jar & d8.bat to dx.jar and dx.bat respectively worked for me as answered here