I recently bought a new laptop, so I went through the process of installing AndroidStudio again. Since I have to find the process again each time, I made a note of it myself.

Also note a problem you encountered when running your project after installing the latest version of AndroidStudio, and how to solve it.

Install the JDK

  1. First of all must be installed JDK, as usual to find jdK1.8 installation package (oracle official website download, AdoptOpenJDK domestic image download). After downloading it, install it and remember the installation path, for example: D:\Java\jdk1.8.0_291.
  2. After installing, configure the environment variables, right-click on my computer, select Properties, and go to Advanced System Settings.Click on environment variablesClick New to create a new system variable named JAVA_HOME with the value of your JDK installation path, such as D:\Java\jdk1.8.0_291 in step 1, and then click OK. After creating the JAVA_HOME variable, click New again to create a new system variable named CLASS_PATH with a value of. %JAVA_HOME%\lib\dt.jar; %JAVA_HOME%\lib\tools.jar; And click OK.After creating JAVA_HOME and CLASS_PATH, select Path in the system variable, double-click or click the Edit button below, click New, add %JAVA_HOME%\bin and %JAVA_HOME%\jre\bin respectively, and click OK.Finally, click Apply on the page of system properties, then press WIN+R, and enter CMD in the input box that pops upOn the command-line interface (CLI), enter Java and javac to verify the configuration. If the output is correct, the configuration is successful.

Install AndroidStudio

Go to the official website to download the latest version of AndroidStudio. After downloading it, install it to the location you want. After installation, you can choose to change it if necessary. AndroidStudio and.gradle cache paths, both of which are caches by default on drive C, probably a lot of people don’t like that their drive C caches a lot of stuff.

  1. Change.AndroidSudio path: Go to the bin file in AndroidStudio and find idea.properties. Open it and change idea.config.path and idea.system.path to the desired path, for example: D:\AndroidConfig\ android. AndroidStudio\config and D:\AndroidConfig\ android. AndroidStudio\system.
  2. Change. Gralde path: Open AndroidStudio SettingGo to Gradle and change Gradle User Home to the path you want, for example: D:\AndroidConfig\ android. Gradle.

The latest version of AndroidStudio installation encountered problems and solutions

After installing the latest version of AndroidStudio this time, I opened my previous project as usual, Could not install Gradle distribution from “\services.gradle.org\ angular \gradle-6.7.1-all.zip”, according to my experience, this kind of problem can be solved by scientific Internet, or download the Gradle package and put it in the corresponding path. The result is that the science web is invalid, and if you download the Gradle package yourself, the path shown in the following figure has not been generated.Finally through a Baidu solution: Download the Gradle package yourself, unzip it and remember the path. Use Gradle from the drop-down box and select Specified location. Enter the Specified location in the input box. For example, D:\AndroidConfi\ android. gradle\wapper\dists\gradle-6.5-all, then click Apply in the lower right corner, close Setting and rebuild the project to compile. Restore Use Gradle from after the first compilation.