1.代理配置
打开/Users/zhangchi/.gradle/gradle.properties
配置使用Mac自己的网络,不使用代理
systemProp.https.nonProxyHosts=localhost
image2.配置gradle的版本
找到Android的路径下/Applications/Android\ Studio.app/Contents/gradle/m2repository/com/android/tools/build/gradle查看版本
image3.然后就是build.gradle 中改配置
buildscript {
repositories {
maven { url "[https://maven.aliyun.com/repository/google](https://maven.aliyun.com/repository/google)" }
maven { url "[https://maven.aliyun.com/repository/jcenter](https://maven.aliyun.com/repository/jcenter)" }
maven { url "[http://maven.aliyun.com/nexus/content/groups/public](http://maven.aliyun.com/nexus/content/groups/public)"}
// google()
// jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'
}
}
image
4.参考网站
网友评论