gradle插件下载不了
解决办法:
- 开启小飞机,科学上网,在Android studio中配置好代理,但是需要将当前系统用户.gradle文件夹下的gradle.properties文件以及项目中的gradle.properties文件中的代理相关的配置删除
org.gradle.jvmargs=-Xmx1536M
#systemProp.http.proxyHost=127.0.0.1
#systemProp.https.proxyPort=1086
#systemProp.https.proxyHost=127.0.0.1
#systemProp.http.proxyPort=1086
- 为当前项目配置国内仓库镜像,修改build.gradle文件
buildscript {
repositories {
// google()
// jcenter()
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/jcenter' }
maven { url 'http://maven.aliyun.com/nexus/content/groups/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
}
}
allprojects {
repositories {
// google()
// jcenter()
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/jcenter' }
maven { url 'http://maven.aliyun.com/nexus/content/groups/public' }
}
}