一、下載gradle.all.zip,並解壓,配置環境變量
windows中
假設windows安裝在 E:\install-dev\gradle-5.6.3 ## 修改為自己的路徑
在path中添加下列信息
查看是否配置成功
二、 配置gradle,加速
在gradle根目錄:\init.d\下,新建一個:init.gradle 文件,添加以下內容
設置gradle的源 為阿里雲
allprojects{
repositories {
def REPOSITORY_URL = 'http://maven.aliyun.com/nexus/content/groups/public/'
all { ArtifactRepository repo ->
def url = repo.url.toString()
if ((repo instanceof MavenArtifactRepository) && (url.startsWith('https://repo1.maven.org/maven2') || url.startsWith('https://jcenter.bintray.com'))) {
project.logger.lifecycle 'Repository ${repo.url} replaced by $REPOSITORY_URL .'
remove repo }
}
maven {
url REPOSITORY_URL }
}}
全部完成。