解决Android studio :Error:Cause: unable to find valid certification path to requested target 解决Android studio :Error:Cause: unable to find valid certification path to requested target

Reprinted: https://www.cnblogs.com/ttxhkx/p/11708123.html


解决Android studio :Error:Cause: unable to find valid certification path to requested target

------------ remember a week unfortunate child struggles

Android studio recently updated to 3.5.1, then appeared Error: Cause: unable to find valid certification path to requested target this error, in short, is always a .pom file or download jar package is not down when gradle update. We tried a variety of methods, last updated inexplicable success. It should play a role in not sure what procedure, so the record about these days use a variety of methods of reference.

First, replace the network

We conducted a total of

  • Campus Network
  • Hot mobile phone
  • The department / school / / Network

However, geese, and no action

Second, the replacement address maven

by

    google()
    jcenter()

Changed

    mavenCentral()
    maven { url 'http://maven.google.com' }
    maven { url 'http://jcenter.bintray.com'}
    maven {
        url 'http://maven.aliyun.com/nexus/content/groups/public/'
    } 

From the blog we found in general so after almost, but still no role for me

Third, reload

Ah, I heard that 90% of the restart can solve the problem, reinstall the problem can be solved 99%

  • Android studio Uninstall
  • Android studio installation

failure

As the remaining 1% left ignorant of tears

Fourth, re-download the file gradle

failure

V. Import Certificate

Well, do not download Android studio down the URL displayed in connection insecure (I doubt this site is no certificate) can not obtain a certificate after open in the browser, so add https://jcenter.bintray.com/ and http : //maven.google.com certificate, and then really failed. emmmmmmmmmmm, but still record what method to add Certificate

1. Open URL need to import certificate, a certificate from the browser

avatar avatar

2. Export the certificate to .cer format

avatar avatar

3. Import Certificates in Android studio's jre \ jre \ lib \ security

avatarKey to: changeit
selection: Y
then or not, the method continues to change

Sixth, modify the hosts file, use the built-sdk manager as online downloads

The basic steps are as follows

1. By a ping sites, such as love or station network https://ping.aizhan.com/ Webmaster Tools http://ping.chinaz.com input dl.google.com (dl-ssl.google.com can not ping oN) in response to the selection of a relatively short period IP

2. ping in cmd can confirm what IP connection.

3. Notepad to open the hosts file. Path: C: \ Windows \ System32 \ drivers \ etc

4. Additional host file:

203.208.43.70 (ping obtained after the IP) dl.google.com
203.208.43.70 dl.l.google.com
203.208.43.70 dl-ssl.google.com

Save.

5. Restart sdk manager, not waiting to load downloaded resources.

Ah, I not only renewed, API from 20-29 I have downloaded, then goose was no use crying chirp.

For more details please move https://blog.csdn.net/qq_37443229/article/details/80956416

Seven, manually update the dependence

在file->Project sructure->denpendencies下
把里面的依赖一个个点进去更新一下,再重新sync avatar

啊哈哈哈哈哈哈哈,成功

(不负责的小声BB:我也不知道究竟具体哪个操作搞定我的Android studio,大家都试一下吧啊哈哈哈哈哈哈哈,逃~( ̄▽ ̄)~*)

 

3
0
« 上一篇: 微信小程序学习
» 下一篇: 找到一篇超详细的解释Android里gradle的博客
    <div class="postDesc">posted on 

2019-10-20 16:57 
ttxhkx 
阅读(9312
评论(4
编辑 
收藏


解决Android studio :Error:Cause: unable to find valid certification path to requested target

————————————记一个倒霉孩子的一周的挣扎

最近更新Android studio至3.5.1,然后出现了Error:Cause: unable to find valid certification path to requested target这个报错,总之就是gradle更新时总有一个.pom文件或者jar包下载不下来。尝试了各种各样的方法,最后更新成功也莫名其妙。应为不知道哪个步骤起了作用,所以记录一下这几天使用的各种方法参考。

一、更换网络

一共进行了

  • 校园网
  • 手机热点
  • 科/学/上/网

然鹅,并没有什么作用

二、更换maven的地址

    google()
    jcenter()

改为

    mavenCentral()
    maven { url 'http://maven.google.com' }
    maven { url 'http://jcenter.bintray.com'}
    maven {
        url 'http://maven.aliyun.com/nexus/content/groups/public/'
    } 

从大家的博客里发现,一般这样之后就差不多了,但是对我依旧没什么作用

三、重装

嗯,听说重启可以解决%90的问题,重装可以解决%99的问题

  • Android studio卸载
  • Android studio安装

失败

作为剩下的%1留下了不学无术的泪水

四、重新下载gradle文件

失败

五、导入证书

唔,在Android studio里下载不下来的网址在浏览器里打开后显示连接不安全(我怀疑这网站就没有证书)获取不到证书,所以添加了https://jcenter.bintray.com/和http://maven.google.com的证书,然后果然失败了。emmmmmmmmmmm,但是还是记录一下添加证书的方法

1.打开需要导入证书的网址,从浏览器中获得证书

avatar avatar

2.将证书以.cer格式导出

avatar avatar

3.在Android studio的jre\jre\lib\security下导入证书

avatar 密钥为:changeit
选择:Y
然后还是不行,继续换方法

六、修改hosts文件,使用as内置sdk管理器在线下载

基本步骤如下

1.通过一个ping网站,如爱站网https://ping.aizhan.com/或站长工具 http://ping.chinaz.com输入dl.google.com(dl-ssl.google.com 无法ping通)挑选一个响应时间较短的IP

2. ping in cmd can confirm what IP connection.

3. Notepad to open the hosts file. Path: C: \ Windows \ System32 \ drivers \ etc

4. Additional host file:

203.208.43.70 (ping obtained after the IP) dl.google.com
203.208.43.70 dl.l.google.com
203.208.43.70 dl-ssl.google.com

Save.

5. Restart sdk manager, not waiting to load downloaded resources.

Ah, I not only renewed, API from 20-29 I have downloaded, then goose was no use crying chirp.

For more details please move https://blog.csdn.net/qq_37443229/article/details/80956416

Seven, manually update the dependence

In file-> Project sructure-> denpendencies
to rely on a point inside look into updating and re-syncavatar

Ah ha ha ha ha ha ha ha, successful

(Not responsible whispered BB: I do not know exactly what the specific operation to get my Android studio, we all try it ah ha ha ha ha ha ha ha, fled ~ (¯ ▽ ¯) ~ *)

 

Guess you like

Origin www.cnblogs.com/jvkal/p/12387882.html