Downloading https://services.gradle.org/distributions/gradle-7.0.2-bin.zip javax.net.ssl.SSLHandshak
Android studio下载 https://services.gradle.org/distributions/gradle-7.0.2-bin.zip 时发生如下异常:
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
但是通过浏览器又是可以正常下载,这个时候我们可以通过浏览器下载下来放到本地的一个目录下,例如: /Users/likunlun/Software/Android/gradle 目录下。
修改 gradle-wrapper.properties 引用本地 gradle-x.x.x-bin.zip
Mac/Linux:
distributionUrl=file\:///Users/likunlun/Software/Android/gradle/gradle-7.0.2-bin.zip
Windows:
distributionUrl=file\:///D:/Android/gradle/gradle-7.0.2-bin.zip
注意: file目录不要有中文和空格
运行指令:
abc:AndroidLint likunlun$ gradlew :app:assemble
Downloading file:/Users/likunlun/Software/Android/gradle/gradle-7.0.2-bin.zip
..........10%...........20%...........30%..........40%...........50%...........60%..........70%...........80%...........90%..........100%
> Configure project :buildSrc
isDebugLintPlugin true
add lintPlugin src
> Configure project :app
Warning: The 'kotlin-android
可以看到从本地下载我们需要的gradle包了。
|