Solve the following sdk component was not installed in Android studio's automatic download of SDK: build-tools-xxx

  1. First find the idea.properties file in the bin directory under the directory where Andriod Studio is installed, and add disable.android.first.run=true to the last line. Then skip the SDK check and arrive at the Andriod Studio window.
  2. Download Android_Sdk independently. Baidu resources are as follows: https://pan.baidu.com/s/1PvQyDcS-Ka2k6F3BeoorLg
    Extraction code: 6666
    If you want to use the emulator for practice, you can download Android_Sdk_Api21_system-images.zip and unzip it to Android\Sdk\ System-images
    description: This SDK is version 29.0.3, and the computer will automatically update
  3. Modify the top-level build.gradle file to specify the dependent libraries as follows:

buildscript {
    
    
    repositories {
    
    
        google()
        jcenter()
        
    }
    dependencies {
    
    
        classpath 'com.android.tools.build:gradle:3.5.2'
    }
}

allprojects {
    
    
    repositories {
    
    
        google()
        jcenter()
        
    }
}

The source identified by google() and jcenter() here is difficult for us to access due to well-known reasons. We can assign the maven warehouse to the maven agent of Alibaba Cloud. Alibaba Cloud's help document is: Alibaba Public Agent Library . According to the document, we replace the content in the top-level build.gradle file with:


buildscript {
    
    
    repositories {
    
    
        maven {
    
     url 'https://maven.aliyun.com/repository/google' }
        maven {
    
     url 'https://maven.aliyun.com/repository/jcenter'}
        mavenLocal()
        mavenCentral()
        //google()
        //jcenter()
        
    }
    dependencies {
    
    
        classpath 'com.android.tools.build:gradle:3.5.2'
    }
}

allprojects {
    
    
    repositories {
    
    
        maven {
    
     url 'https://maven.aliyun.com/repository/google' }
        maven {
    
     url 'https://maven.aliyun.com/repository/jcenter'}
        mavenLocal()
        mavenCentral()
        //google()
        //jcenter()
        
    }
}
  1. Unzip the file to D drive, open Andriod Studio, File——>Project Structure...
    change the SDK address to the following figure: D:\Android_Sdk_Api21\Android\Sdk
    Insert picture description here
  2. At this time, open D:\Android_Sdk_Api21\Android\Sdk\build-tools and
    you will find the updated version 30.0.3 of the new SDK file

Guess you like

Origin blog.csdn.net/xun08042/article/details/114434022