微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

PKIX 路径构建失败:sun.security.provider.certpath.SunCertPathBuilderException:在代理后面

如何解决PKIX 路径构建失败:sun.security.provider.certpath.SunCertPathBuilderException:在代理后面

Android Studio 突然开始报错:

A problem occurred configuring root project 'Projectname'.
> Could not resolve all artifacts for configuration ':classpath'.
   > Could not download gradle.jar (com.android.tools.build:gradle:3.4.2)
      > Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.4.2/gradle-3.4.2.jar'.
         > Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.4.2/gradle-3.4.2.jar'.
            > Connection reset

   > Could not download builder.jar (com.android.tools.build:builder:3.4.2)
      > Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/builder/3.4.2/builder-3.4.2.jar'.
         > Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/builder/3.4.2/builder-3.4.2.jar'.
            > PKIX path building Failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
   > Could not download tracker.jar (com.android.tools.analytics-library:tracker:26.4.2)

我已经导出了证书(名称:dlgooglecom)并将其添加到 cacert 但仍然出现相同的错误

 keytool.exe -import -trustcacerts -alias androidstudiocerts -file dlgooglecom.cer -keystore "C:\Program Files\Android\Android Studio1\jre\lib\security\cacerts"

输出

C:\Program Files\Android\Android Studio1\jre\bin> keytool.exe -import -trustcacerts -alias dlgoogle1 -file dlgooglecom.cer -keystore "C:\Program Files\Android\Android Studio1\jre\lib\security\cacerts"
Warning: use -cacerts option to access cacerts keystore
Enter keystore password:
Certificate already exists in keystore under alias <dlgoogle>
Do you still want to add it? [no]:  yes
Certificate was added to keystore

有人可以指导吗。我支持代理,代理连接工作正常。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。