解决Android Studio(2022版)gradle下载慢问题
由于新版AS将allprojects独立出来变为setting.gradle, 所以我们只需要更改setting.gradle即可:
将以下对应阿里云镜像添加到google和mavenCentral上方,优先从国内源下载,如果没有再去原网站下。
maven { url 'https://maven.aliyun.com/repository/google' }maven { url 'https://maven.aliyun.com/repository/public' }
pluginManagement { repositories { gradlePluginPortal() maven { url 'https://maven.aliyun.com/repository/google' } maven { url 'https://maven.aliyun.com/repository/public' } google() mavenCentral()// jcenter() }}dependencyResolutionManagement { repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) repositories { maven { url 'https://maven.aliyun.com/repository/google' } maven { url 'https://maven.aliyun.com/repository/public' } google() mavenCentral() }}
附其它源地址和阿里云地址的对应关系网址:
仓库名称 | 阿里云仓库地址 | 阿里云仓库地址(老版) | 源地址 |
central | |||
jcenter | |||
public | central仓和jcenter仓的聚合仓 | ||
| |||
gradle-plugin | https://maven.aliyun.com/nexus/content/repositories/gradle-plugin | ||
spring | |||
spring-plugin | https://maven.aliyun.com/nexus/content/repositories/spring-plugin | ||
grails-core | https://maven.aliyun.com/nexus/content/repositories/grails-core | ||
apache snapshots | https://maven.aliyun.com/nexus/content/repositories/apache-snapshots |
------------------------------------------------------更新Kotlin版本设置-------------------------------------------------
maven(url = "https://maven.aliyun.com/repository/google")maven(url = "https://maven.aliyun.com/repository/public")
来源地址:https://blog.csdn.net/LYFly0016/article/details/129222714
免责声明:
① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。
② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341