In the case of corresponding build and build plugin versions:
1. Adding build.gradle
maven { url "https://jitpack.io" }
jcenter() {
url 'https://maven.aliyun.com/repository/jcenter'
}
2. Add gradle.properties file
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.parallel=true
org.gradle.daemon=true
org.gradle.configureondemand=true
3. Modify the settings File---->Settings----> Build, Execution, Deployment----> Compiler----> Command-line Options: (fill in: --offline) ----> Apply ----> OK