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 (将#修改为@)