问题
初次打开项目,gradle等第三方下载很久、编译很久、跑项目很久
解决:设置国内代理
原因:资源在国外,下载太慢
将build.gradle设置成阿里云代理,去阿里云下载
buildscript {
repositories {
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
maven { url 'https://maven.aliyun.com/repository/jcenter' }
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/central' }
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
google()
maven {url 'https://developer.huawei.com/repo/'}
}
}
...
allprojects {
repositories {
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
maven { url 'https://maven.aliyun.com/repository/jcenter' }
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/central' }
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
google()
maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/'}
maven { url 'https://jitpack.io' }
maven {
url 'http://maven.aliyun.com/nexus/content/repositories/releases/'
}
maven {url 'https://developer.huawei.com/repo/'}
}
}