默認的地址下載速度極慢 (依賴項幾個小時也下載不完)
改為 阿里源, 1分鐘就下載ok了.文章來源:http://www.zghlxwxcb.cn/news/detail-726887.html
代碼
修改根目錄中 的 settings.gradle
文件文章來源地址http://www.zghlxwxcb.cn/news/detail-726887.html
內容
pluginManagement {
repositories {
//新增這 4 個
maven { url 'https://maven.aliyun.com/repository/public/' }
maven { url 'https://maven.aliyun.com/repository/google/' }
maven { url 'https://maven.aliyun.com/repository/jcenter/' }
maven { url 'https://maven.aliyun.com/repository/central/' }
google()
mavenCentral()
gradlePluginPortal()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
//新增這 4 個
maven { url 'https://maven.aliyun.com/repository/public/' }
maven { url 'https://maven.aliyun.com/repository/google/' }
maven { url 'https://maven.aliyun.com/repository/jcenter/' }
maven { url 'https://maven.aliyun.com/repository/central/' }
google()
mavenCentral()
}
}
rootProject.name = "My Application"
include ':app'
到了這里,關于android studio gradle 使用阿里源 (修改 settings.gradle)的文章就介紹完了。如果您還想了解更多內容,請在右上角搜索TOY模板網以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網!