LoginSignup
5
3

More than 1 year has passed since last update.

【Android Kotlin】Installed Build Tools revision 31.0.0 is corruptedの対処法

Last updated at Posted at 2021-07-25

環境

  • Android Studio 4.2.2

エラー内容

新規プロジェクトを作成した時,あるいはRun 'app'をした時に,以下のエラーが発生する場合があります.

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

対処法

以下のようにapp/build.gradleを書き換えることでエラーを解決できます.

変更前

app/build.gradle
android {
    compileSdkVersion 31
    buildToolsVersion "31.0.0"

    defaultConfig {
        applicationId "app.myouji.nickname.myapplication"
        minSdkVersion 21
        targetSdkVersion 31
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    ~ 省略 ~

}

変更後

app/build.gradle
android {
    compileSdkVersion 31
    buildToolsVersion "30.0.3" //変更

    defaultConfig {
        applicationId "app.myouji.nickname.myapplication"
        minSdkVersion 21
        targetSdkVersion 30 //変更
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    ~ 省略 ~

}

参考記事

5
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
3