Step 1 : Check the version
JDK1.5 and above to support gradle. If the machine does not have a JDK, you need to install the JDK first. The JDK version I installed locally is 1.8.
Step 2 : Download
gradle. You can go directly to the official website to download gradle. The version type can be selectively downloaded according to your actual situation;
gradle official website download address ;
Step 3 : Unzip the compressed package and unzip
the downloaded package to the path that needs to be stored , This path is needed when configuring environment variables below, my path is: F:\gradle-7.0-milestone-2
Step 4 : Configure environment variables
1. Configure gradle environment variables, create a new variable name GRADLE_HOME in the system environment variables, and add the path where gradle is stored.
2. Create a new variable name GRADLE_USER_HOME in the system environment variables (PS: This is the warehouse address, you can also use the default, just find a large storage space, according to your own situation)
If you don’t create it, the default is: C:\Users\ own computer name.gradle is stored here
3. Add %GRADLE_HOME%\bin to the PATH and then
Step 5 : Verify the version
WIN+R Open the cmd command window and enter gradle- v You can see the installed gradle version number: it
proves that the configuration is installed successfully, which can be used in the project.
(Ps: You can create an init.gradle file in the init.d folder to configure the company's internal warehouse address or other address configuration):
buildscript {
repositories {
maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }
maven{ url 'https://maven.aliyun.com/nexus/content/repositories/jcenter'}
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }
maven{ url 'https://maven.aliyun.com/nexus/content/repositories/jcenter'}
}
}
(If there is an error, please also point it out)