pkix路径生成失败:sun.security.provider.certpath.suncertpathbuilderexception:在代理之后

zfycwa2u  于 2021-08-20  发布在  Java
关注(0)|答案(0)|浏览(342)

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

请有人给我引路好吗。我支持代理,代理连接工作正常。

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题