Graphic tutorial of Android studio installation and configuration method

This article mainly explains some problems encountered in installing Android studio and configuring environment variables, as well as solutions.

Required software: andriodstudio installation package. Java se development kit (JDK)

Installing Android studio is very simple. You just need to execute the installation package, select the required directory and install it

Here, briefly introduce the JDK installation and the configuration of environment variables:

Select the installation directory to install the JDK. Two installation prompts will appear during the installation process. The first time is to install JDK and the second time is to install JRE. It is recommended that both be installed in different folders in the same Java folder. (both cannot be installed in the root directory of the Java folder, and errors will occur when JDK and JRE are installed in the same folder). It should also be noted here that you must remember which folder JDK is installed in, which will be used when configuring environment variables in the next stage, as shown in the following figure:

1: Choose the directory to install JDK at will. Just modify the directory before the default installation directory \ Java. 2: install JRE → change → \ the directory before Java is the same as the directory to install JDK. Note: if there is no installation directory requirement, it can be set by default. There is no need to make any modification. Click Next twice.

After installing JDK, we need to configure environment variables

a. Computer → properties → advanced system settings → advanced → environment variables

b. System variable → new Java_ Home variable.

Fill in the JDK installation directory with the variable value (I am e: \ program files (x86) \ Java \ jdk1.8.0_121)

c. System variable → find path variable → edit

Enter% Java at the end of the variable value_ HOME%\bin;% JAVA_ HOME%\jre\bin; (note whether there is a; sign at the end of the original path variable value. If not, enter the; sign first and then the above code)

d. System variable → new classpath variable

Fill in the variable value.;% JAVA_ HOME%\lib;% JAVA_ Home% \ lib \ tools.jar (note the first point) system variable configuration is completed

e. Check whether the configuration is successful. Run CMD and enter java version (there is a space between Java and - Version). If the version information is displayed as shown in the figure, the installation and configuration are successful.

The above is what you need to pay attention to when installing JDK and the configuration of environment variables. Next, we will explain Android studio;

Possible problems and solutions for the first use of Android studio

1. When you start as, you will be prompted unable to access Android SDK add on list

Causes:

The Android studio you installed does not have an SDK. This problem may occur because the installation package you downloaded does not contain an SDK and your computer does not have an SDK locally;

terms of settlement:

Find it in the directory of your installation: Bin \ idea.properties. Open the file and add a line disable. Android. First. Run = true at the end. Note: you can open it with tools such as editeditplus or txt.

2. When Android studio creates / imports a project, it is always in building "XXX" gradle project info and will wait for problems

Causes:

Open the file gradle \ wrapper \ gradle-wrapper.properties under the Android studio project to see the contents

The key lies in the last sentence. Android studio will download gradle-3.3-all.zip online. This sentence is requesting Google server, but it is very slow, so it will be loading all the time;

You can enter: computer → C → user → computer name → gradle → wrapper → dits → gradle-3.3-all

You can see the file shown in the figure below, which means that it is downloading, but it is very slow

terms of settlement:

Download the offline package directly on the Internet to solve the problem

1. First, check the version of the required offline package and find the folder C: \ users \ computer name \. Gradle \ wrapper \ dists \ gradle-x.x.x-all. X.x.x is the corresponding version number. For example, 3.3, Download gradle-3.3-all.zip.

Download address: @ L_ 419_ 0 @ password: pku8

2. Then put the downloaded zip package in C: \ users \ computer name \. Gradle \ wrapper \ dists \ gradle-x.x.x-all \ c64ydeuardnfqctvr1gm30w53 directory, restart Android studio, and it will be automatically decompressed, or directly click sync project gradle files on the Android studio toolbar.

The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>