首页 > 基础资料 博客日记

解决Android Studio(2022版)gradle下载慢问题

2023-07-24 14:03:02基础资料围观310

这篇文章介绍了解决Android Studio(2022版)gradle下载慢问题,分享给大家做个参考,收藏Java资料网收获更多编程知识

由于新版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()
    }
}

附其它源地址和阿里云地址的对应关系网址:

仓库服务 (aliyun.com)

仓库名称

阿里云仓库地址

阿里云仓库地址(老版)

源地址

central

https://maven.aliyun.com/repository/central

https://maven.aliyun.com/nexus/content/repositories/central

https://repo1.maven.org/maven2/

jcenter

https://maven.aliyun.com/repository/public

https://maven.aliyun.com/nexus/content/repositories/jcenter

http://jcenter.bintray.com/

public

https://maven.aliyun.com/repository/public

https://maven.aliyun.com/nexus/content/groups/public

central仓和jcenter仓的聚合仓

google

https://maven.aliyun.com/repository/google

https://maven.aliyun.com/nexus/content/repositories/google

https://maven.google.com/

gradle-plugin

https://maven.aliyun.com/repository/gradle-plugin

https://maven.aliyun.com/nexus/content/repositories/gradle-plugin

https://plugins.gradle.org/m2/

spring

https://maven.aliyun.com/repository/spring

https://maven.aliyun.com/nexus/content/repositories/spring

http://repo.spring.io/libs-milestone/

spring-plugin

https://maven.aliyun.com/repository/spring-plugin

https://maven.aliyun.com/nexus/content/repositories/spring-plugin

http://repo.spring.io/plugins-release/

grails-core

https://maven.aliyun.com/repository/grails-core

https://maven.aliyun.com/nexus/content/repositories/grails-core

https://repo.grails.org/grails/core

apache snapshots

https://maven.aliyun.com/repository/apache-snapshots

https://maven.aliyun.com/nexus/content/repositories/apache-snapshots

https://repository.apache.org/snapshots/


文章来源:https://blog.csdn.net/LYFly0016/article/details/129222714
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:jacktools123@163.com进行投诉反馈,一经查实,立即删除!

标签:

相关文章

本站推荐

标签云