可能发生这个问题的几种原因:
1.settings 里的http porxy的设定无法链接网络
2.如图所示项目中内置的代理不可用 如圈内注释即可
3.下载源出错
google网络连不上,切换仓库路径 , 阿里的仓库地址 https://developer.aliyun.com/mvn/guide
如果还是慢,注销掉google() 与 jcenter()在重新编译
pluginManagement { repositories { maven { url 'https://maven.aliyun.com/repository/central' } maven { url 'https://maven.aliyun.com/repository/public' } maven { url 'https://maven.aliyun.com/repository/google' } maven { url 'https://maven.aliyun.com/repository/gradle-plugin' } gradlePluginPortal() google() jcenter() mavenCentral() } } dependencyResolutionManagement { repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) repositories { maven { url 'https://maven.aliyun.com/repository/central' } maven { url 'https://maven.aliyun.com/repository/public' } maven { url 'https://maven.aliyun.com/repository/google' } maven { url 'https://maven.aliyun.com/repository/gradle-plugin' } google() jcenter() mavenCentral() maven {url "https://jitpack.io"} } }