默认的地址下载速度极慢 (依赖项几个小时也下载不完)
改为 阿里源, 1分钟就下载ok了.
代码
修改根目录中 的 settings.gradle
文件
内容
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'
来源地址:https://blog.csdn.net/qq_37214567/article/details/129336970