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

**URL:** <https://discuss.bitrise.io/t/installed-build-tools-revision-31-0-0-is-corrupted-remove-and-install-again-using-the-sdk-manager/18142>\
**Category:** Builds\
**Tags:** android\
**Created:** [September 29, 2021, 11:54pm UTC](https://discuss.bitrise.io/t/installed-build-tools-revision-31-0-0-is-corrupted-remove-and-install-again-using-the-sdk-manager/18142 "2021-09-29T23:54:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ergindogan](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/ergindogan/32/3981_2.png) [@ergindogan](https://discuss.bitrise.io/u/ergindogan)\
**Post date:** [September 29, 2021, 11:54pm UTC](https://discuss.bitrise.io/t/installed-build-tools-revision-31-0-0-is-corrupted-remove-and-install-again-using-the-sdk-manager/18142/1 "2021-09-29T23:54:54Z")

</div>

# Bitrise Build Issue Report template

## Description of the issue

We are preparing our app for Android 12 change by updating our compile sdk and target sdk versions to 31. Our current dev workflow is failing to build and giving and error:

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

Funny enough I got this error on my local setup and able to resolve it by following the method described in [stackoverflow](https://stackoverflow.com/a/68430992)

## Environment:

**Where did the issue happen?**

Android & Docker, on Ubuntu 20.04

**Which build Step causes the issue and which version of the step?**

Android Unit Test

## Reproducibility

- _Does a “Rebuild” help? (You can trigger a rebuild from the Build’s page, by clicking the “Rebuild” button in the top right corner of a finished build)_ : NO
- _Does a rebuild without caches help? (You can remove the `Cache:Pull` and `Cache:Push` steps temporarily to not to use the cache, or [you can delete all the caches on the `Settings` tab of the app](http://devcenter.bitrise.io/caching/about-caching/#downloading-and-deleting-caches)._ : NO
- _Does the issue happen sporadically, or every time?_ : Every time
- _Does upgrading the build Step to the latest version help?_ : NO
- _When did the issue start?_ : Ever since the first build with API level 31

### Local reproduction

_Can it be reproduced on your own Mac/PC by following our [local debug guide](http://discuss.bitrise.io/t/how-to-debug-your-build-locally-it-works-on-my-mac-pc-but-not-on-bitrise-io/392)? Please follow at least the first section (“Testing with a full clean git clone”) to make sure to test the state of the code what [bitrise.io](http://bitrise.io) will get when it does a git clone in the clean environment! If possible please note which sections you tried._

No applicable, able to resolve the issue locally with the method described above.

### Local reproduction: Linux / Android (docker based) stack builds

_Can it be reproduced by running the build locally, after doing a new git clone of the repository into the `/tmp` directory and running the build from there with the Bitrise CLI ( [Bitrise CLI](https://www.bitrise.io/cli) )? If no, can it be reproduced with Docker (using the same docker images / environment we use on [bitrise.io](http://bitrise.io))? Related guide: [Running your build locally in Docker](http://devcenter.bitrise.io/docker/run-your-build-locally-in-docker/) ._

No applicable, able to resolve the issue locally with the method described above.

## Build log

_Please copy paste the build’s [bitrise.io](http://bitrise.io) URL here (or if the issue happens somewhere else then the full logs), or if you can’t share the url / log here then send the url or full log through a private channel (e.g. email - [Contact us](https://www.bitrise.io/contact) ), with a link to the related Discuss issue._

> **[Log in - Bitrise](https://app.bitrise.io/users/sign_in)**
>
> Bringing back the joy of iOS & Android development through automating build, testing and support cycles.

---

<div class="post-metadata">

**Author:** ![mkucharski17](https://avatars.discourse-cdn.com/v4/letter/m/e99b99/32.png) [@mkucharski17](https://discuss.bitrise.io/u/mkucharski17)\
**Post date:** [October 3, 2021, 12:13pm UTC](https://discuss.bitrise.io/t/installed-build-tools-revision-31-0-0-is-corrupted-remove-and-install-again-using-the-sdk-manager/18142/2 "2021-10-03T12:13:14Z")

</div>

I have the same problem with a flutter app.

---

<div class="post-metadata">

**Author:** ![mkucharski17](https://avatars.discourse-cdn.com/v4/letter/m/e99b99/32.png) [@mkucharski17](https://discuss.bitrise.io/u/mkucharski17)\
**Post date:** [October 6, 2021, 5:10pm UTC](https://discuss.bitrise.io/t/installed-build-tools-revision-31-0-0-is-corrupted-remove-and-install-again-using-the-sdk-manager/18142/3 "2021-10-06T17:10:51Z")

</div>

I have found solution. Try adding this script before building android apk/aab.

````auto
#!/usr/bin/env bash
# fail if any commands fails
set -e
# debug log
set -x

# write your script here
sdkmanager --install "build-tools;31.0.0" &&

  cd /usr/local/share/android-sdk/build-tools/31.0.0 \
  && mv d8 dx \
  && cd lib \
  && mv d8.jar dx.jar```
````

---

<div class="post-metadata">

**Author:** ![ergindogan](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/ergindogan/32/3981_2.png) [@ergindogan](https://discuss.bitrise.io/u/ergindogan)\
**Post date:** [October 8, 2021, 10:02pm UTC](https://discuss.bitrise.io/t/installed-build-tools-revision-31-0-0-is-corrupted-remove-and-install-again-using-the-sdk-manager/18142/4 "2021-10-08T22:02:28Z")

</div>

Hey thanks for the solution, I had to update the sdk location for me to:

```auto
cd /opt/android-sdk-linux/build-tools/31.0.0 \

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/bitrise/original/2X/d/d901cf2aad020f2dd11918afc89ec2089bb87b35.png) [@system](https://discuss.bitrise.io/u/system)\
**Post date:** [November 7, 2021, 10:02pm UTC](https://discuss.bitrise.io/t/installed-build-tools-revision-31-0-0-is-corrupted-remove-and-install-again-using-the-sdk-manager/18142/5 "2021-11-07T22:02:48Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
