解决Android Studio不能下载Gradle的教程Could not install Gradle distribution from ‘https:services.gradle.orgdistrib
错误信息都有哪些:
Could not install Gradle distribution from ‘https://services.gradle.org/distributions/gradle-8.8-bin.zip’.
Reason: javax.net.ssl.SSLException: Unsupported or unrecognized SSL message
Could not install Gradle distribution from ‘https://services.gradle.org/distributions/gradle-7.2-bin.zip’.
Could not install Gradle distribution from ‘https://services.gradle.org/distributions/gradle-8.0-bin.zip’.
Reason: java.net.SocketTimeoutException: Connect timed out
Could not install Gradle distribution from ‘https://services.gradle.org/distributions/gradle-5.2-bin.zip’.
Reason: javax.net.ssl.SSLException: Unsupported or unrecognized SSL message
Could not install Gradle distribution from ‘https://services.gradle.org/distributions/gradle-8.4-bin.zip’.
Reason: java.io.EOFException: SSL peer shut down incorrectly
Could not install Gradle distribution from ‘https://services.gradle.org/distributions/gradle-8.0-bin.zip’.
Reason: javax.net.ssl.SSLException: Unsupported or unrecognized SSL message
Cannot use connection to Gradle distribution ‘https://services.gradle.org/distributions/gradle-8.8-bin.zip’ as it has been stopped.
解决方法一
gradle各个版本的下载链接:
https://pan.quark.cn/s/4b4547cdc339(最全版本,保存到网盘)
1、如果你是第一次安装使用Android Stduio,第一次运行肯定要先下载gradle,因为我们是用外网下载的,所以经常会导致失败报错。所以我们需要先找到自己的gradle目录,默认是在C:\Users\user.gradle\wrapper\dists,这里的user是你自己的用户名。
这次我以gradle8.8演示
2.点开刚刚不能下载的文件夹,gradle-8.8-bin,里面有一个乱码文件夹,把zip拷贝到这个目录,然后选择解压到当前文件夹
之后就可以再次同步
如果还是有问题检查下是否有这个.ok文件,没有就手动改一个,以及可以把.part删掉(删不删都行,看能不能跑)。
解决方法二
国内镜像站点提供的解决方案
为了解决Gradle下载过慢的问题,我们可以利用国内优秀的镜像站点来加速下载。以下是一些国内镜像站点提供的Gradle下载地址:
官网地址:https://services.gradle.org/distributions/
腾讯云镜像 Gradle下载地址:https://mirrors.cloud.tencent.com/gradle/
阿里云镜像 Gradle下载地址:https://mirrors.aliyun.com/macports/distfiles/gradle/
阿里云镜像 Gradle下载地址:https://mirrors.aliyun.com/gradle/
借助这些国内的镜像站点,我们能够以更快的速度获取到 Gradle 的安装包。如此一来,便可以有效避免因官方下载地址而产生的下载速度缓慢的问题,进而极大地提高我们的开发效率。