解决Android Studio弹出unable to access android sdk add-on list的解决方案

2021/09/11 android 共 1380 字,约 4 分钟

关键词:安卓,Android,AndroidStudio

unable to access android sdk add-on list

进入网站http://ping.chinaz.com/,进行 dl.google.com ping检查,选择大陆响应时间最短的IP地址。进入cmd对此IP地址进行ping测试,如果可以将(IP地址 dl.google.com)加入hosts文件中 hosts文件地址:C:\WINDOWS\System32\drivers\etc\hosts

180.163.150.161 	dl.google.com

Could not install Gradle distribution from

找到 gradle-wrapper.properties文件

#Thu Jun 24 17:20:33 CST 2021
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME

替换distributionUrl为国内镜像,例如

  • 「腾讯gradle镜像」地址:https://mirrors.cloud.tencent.com/gradle/
#Thu Jun 24 17:20:33 CST 2021
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://mirrors.cloud.tencent.com/gradle/gradle-6.7.1-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME

Gradle Could not GET https://dl.google.com/…/xxx.pom

AndroidStudio设置里Http proxy 选择 No proxy 模式。

修改gradle配置文件,找到C:\Users\userName.gradle\gradle.properties 配置文件, 去掉多余的代理配置。

build.gradle替换google()和jcenter()

google()
jcenter()

替换为下面

maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/jcenter' }
maven { url 'http://maven.aliyun.com/nexus/content/groups/public' }

文档信息

Search

    Table of Contents