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

Posted LYFly0016

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了解决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()
    

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

仓库服务 (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/

如何解决在Android Studio上导入GitHub旧项目后,左边的project不见了

在Android Studio上导入GitHub旧项目后,左边的project不见了,如下:

这project不见了,怎么回事

解决:

这project就是已经放在我电脑的路经目录上了,我这project名是CodeDemo,如下:

这project的插件和gradle的版本号可能和本人as的不一致,要查看一下

一、这project:
插件,project的build.gr

以上是关于解决Android Studio(2022版)gradle下载慢问题的主要内容,如果未能解决你的问题,请参考以下文章

Android Studio Electric Eel (2022.1.1) 现已发布

Android Studio Electric Eel (2022.1.1) 现已发布

Android Studio Electric Eel (2022.1.1) 现已发布

Mac版Android Studio查看不到源码的解决方法

Android Studio gradle代理

如何解决在Android Studio上导入GitHub旧项目后,左边的project不见了