Clean Blank Android App fails to build - 'failed to find Build Tools revision 23.0.0 rc1'

后端 未结 3 1954
花落未央
花落未央 2020-12-31 18:27

New to Android, Tried to build a clean \'Blank App\' android project.

I get the below error, which is confusing because I have version 24 installed using the SDK ma

相关标签:
3条回答
  • 2020-12-31 18:58

    If you cannot find 23.0.0 rc1 in sdk mananger, you can modify gradle's sdk version. How? edit build.gradle like this, and change buildToolsVersion.

    android {
        compileSdkVersion 22
        buildToolsVersion "23.0.1"
    
        defaultConfig {
            applicationId "com.sunjiajia.androidnewwidgetsdemo"
            minSdkVersion 14
                targetSdkVersion 22
            versionCode 1
            versionName "1.0"
        }
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
    }
    
    0 讨论(0)
  • 2020-12-31 19:05

    find the BuildTools ids you want to install,

    ANDROID_HOME=/Users/prayagupd/Library/Android/sdk/
    
    $ANDROID_HOME/tools/android list sdk -a | grep "revision 23"
      10- Android SDK Build-tools, revision 23.0.3
      11- Android SDK Build-tools, revision 23.0.2
      12- Android SDK Build-tools, revision 23.0.1
      13- Android SDK Build-tools, revision 23 (Obsolete)
    

    Then, install the buildTool version you want, eg. 23.0.1 as 23 is obsolete.

    $ANDROID_HOME/tools/android update sdk -a -u -t 12
    

    You can achieve the same thing using

    $ANDROID_HOME/tools/android sdk
    

    which will show the buildTools in UI as below,

    Then ./gradlew clean build should be SUCCESSFUL.

    0 讨论(0)
  • 2020-12-31 19:08

    Open the SDK Manager and find the version of the Android SDK Build-tools which is installed and that you want to use. Then go to Gradle Scripts > build.gradle (Module: app). Set the buildToolsVersion to your version.

    Edit: There is an easier solution. Right click on the project > Open Module Settings. Choose the Complie Sdk Version and Build Tools Version you want to use.

    0 讨论(0)
提交回复
热议问题