[Fix] Installed Build Tools revision 31.0.0 is corrupted. Remove and install again using the SDK Manager

The Error “Installed Build Tools revision 31.0.0 is corrupted. Remove and install again using the SDK Manager.”, is an error that is invoked when you are trying to run the code in SDK Manager version 31.0.0. Given below is the snippet of the error you might get:

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

I would like to share with you the steps I took to fix the “Installed Build Tools revision 31.0.0 is corrupted. Remove and install again using the SDK Manager.”

Why “Installed Build Tools revision 31.0.0 is corrupted. Remove and install again using the SDK Manager.” Error is Seen?

The error, “Installed Build Tools revision 31.0.0 is corrupted. Remove and install again using the SDK Manager.” is seen because of missing files “dx.bat and dx.jar” in SDK build tool 31.

There is no need to downgrade the SDK build tool from 31 to 30 or change compile SDK version as it seems to be mentioned in the error.

The detailed solution to fix the error “Installed Build Tools revision 31.0.0 is corrupted. Remove and install again using the SDK Manager.”, is given below:

How to fix the error “Installed Build Tools revision 31.0.0 is corrupted. Remove and install again using the SDK Manager.”?

To fix the error, you will have to check the files, dx.bat and dx.jar, these files must be named d8 in the file locations so just changing their name to dx will solve the error.

To fix the error, “Installed Build Tools revision 31.0.0 is corrupted. Remove and install again using the SDK Manager.”, you will have to check the files, dx.bat and dx.jar and these must be named as d8 in the file locations so just changing their name to dx will solve the error.

Follow one of the below-mentioned methods depending on your operating system:

Method 1: For windows

To fix the error follow the steps mentioned below:

Step 1: First you have to go to the location mentioned below: "C:\Users\user\AppData\Local\Android\Sdk\build-tools\31.0.0"

Step 2: The next step is to find a file named d8.bat. This will be a Windows batch file.

Step 3: Then rename d8.bat to dx.bat.

Step 4: In the folder lib in the following location, “C:\Users\user\AppData\Local\Android\Sdk\build-tools\31.0.0\lib”

Step 5: Finally rename your d8.jar to dx.jar

Make a note that AppData is a hidden folder. Make sure to switch on hidden items to see the AppData folder.

This should fix the error, “Installed Build Tools revision 31.0.0 is corrupted. Remove and install again using the SDK Manager.”

Method 2: For macos or Linux

To fix the error you have to change your android SDK path to the code mentioned below:

cd ~/Library/Android/sdk/build-tools/31.0.0 \
  && mv d8 dx \
  && cd lib  \
  && mv d8.jar dx.jar

This should fix the error, ” Installed Build Tools revision 31.0.0 is corrupted. Remove and install again using the SDK Manager.”

Conclusion

To fix the error “Installed Build Tools revision 31.0.0 is corrupted. Remove and install again using the SDK Manager.”, you will have to check the files, dx.bat and dx.jar, these files must be named d8 in the file locations so just changing their name to dx will solve the error “Installed Build Tools revision 31.0.0 is corrupted. Remove and install again using the SDK Manager”.