我是mac ,Androidstudio 2021 , 创建一个android 项目,gradle下载失败,折腾了半天,以下是解决方法:
1.出现的错误:
无法下载gradle ,
2.解决方法
使用腾讯的镜像,这里的
地址为:https://mirrors.cloud.tencent.com/gradle/gradle-8.4-all.zip
后面的版本可以按自己的需求随意切换
然后保存就可以顺利下载gradle,不过gradle 镜像还是下载速度很慢,切换国内源:
pluginManagement { repositories { maven { url 'https://plugins.gradle.org/m2/' } maven { url 'https://maven.aliyun.com/nexus/content/repositories/google' } maven { url 'https://maven.aliyun.com/nexus/content/groups/public' } maven { url 'https://maven.aliyun.com/nexus/content/repositories/jcenter'} gradlePluginPortal() google() mavenCentral() } } dependencyResolutionManagement { repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) repositories { maven { url 'https://plugins.gradle.org/m2/' } maven { url 'https://maven.aliyun.com/nexus/content/repositories/google' } maven { url 'https://maven.aliyun.com/nexus/content/groups/public' } maven { url 'https://maven.aliyun.com/nexus/content/repositories/jcenter'} google() mavenCentral() } } rootProject.name = "My Application2" include ':app'
标签:url,Gradle,maven,nexus,Studio,2021,https,gradle,com From: https://www.cnblogs.com/adamCode/p/18063278