DevEco Studio编译报错:PKIX path building failed: sun.security.provider.certpath.

492 阅读1分钟

DevEco Studio 编译报错:PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'MyApplication'.
> Could not resolve all files for configuration ':classpath'.
   > Could not resolve com.fasterxml.jackson.core:jackson-core:2.13.2.
     Required by:
         project : > com.huawei.ohos:hap:3.1.5.0
      > Could not resolve com.fasterxml.jackson.core:jackson-core:2.13.2.
         > Could not get resource 'https://repo.huaweicloud.com/repository/maven/com/fasterxml/jackson/core/jackson-core/2.13.2/jackson-core-2.13.2.pom'.
            > Could not GET 'https://repo.huaweicloud.com/repository/maven/com/fasterxml/jackson/core/jackson-core/2.13.2/jackson-core-2.13.2.pom'.
               > The server may not support the client's requested TLS protocol versions: (TLSv1.2, TLSv1.3). You may need to configure the client to allow other protocols to be used. See: https://docs.gradle.org/7.3/userguide/build_environment.html#gradle_system_properties
                  > PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
   > Could not resolve com.fasterxml.jackson.core:jackson-databind:2.13.2.1.
     Required by:
         project : > com.huawei.ohos:hap:3.1.5.0
      > Could not resolve com.fasterxml.jackson.core:jackson-databind:2.13.2.1.
         > Could not get resource 'https://repo.huaweicloud.com/repository/maven/com/fasterxml/jackson/core/jackson-databind/2.13.2.1/jackson-databind-2.13.2.1.pom'.
            > Could not GET 'https://repo.huaweicloud.com/repository/maven/com/fasterxml/jackson/core/jackson-databind/2.13.2.1/jackson-databind-2.13.2.1.pom'.
               > The server may not support the client's requested TLS protocol versions: (TLSv1.2, TLSv1.3). You may need to configure the client to allow other protocols to be used. See: https://docs.gradle.org/7.3/userguide/build_environment.html#gradle_system_properties
                  > PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
   > Could not resolve com.fasterxml.jackson.core:jackson-annotations:2.13.2.
     Required by:
         project : > com.huawei.ohos:hap:3.1.5.0
      > Could not resolve com.fasterxml.jackson.core:jackson-annotations:2.13.2.
         > Could not get resource 'https://repo.huaweicloud.com/repository/maven/com/fasterxml/jackson/core/jackson-annotations/2.13.2/jackson-annotations-2.13.2.pom'.
            > Could not GET 'https://repo.huaweicloud.com/repository/maven/com/fasterxml/jackson/core/jackson-annotations/2.13.2/jackson-annotations-2.13.2.pom'.
               > The server may not support the client's requested TLS protocol versions: (TLSv1.2, TLSv1.3). You may need to configure the client to allow other protocols to be used. See: https://docs.gradle.org/7.3/userguide/build_environment.html#gradle_system_properties
                  > PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
   > Could not resolve org.dom4j:dom4j:2.1.3.
     Required by:
         project : > com.huawei.ohos:hap:3.1.5.0
      > Could not resolve org.dom4j:dom4j:2.1.3.
         > Could not get resource 'https://repo.huaweicloud.com/repository/maven/org/dom4j/dom4j/2.1.3/dom4j-2.1.3.pom'.
            > Could not GET 'https://repo.huaweicloud.com/repository/maven/org/dom4j/dom4j/2.1.3/dom4j-2.1.3.pom'.
               > The server may not support the client's requested TLS protocol versions: (TLSv1.2, TLSv1.3). You may need to configure the client to allow other protocols to be used. See: https://docs.gradle.org/7.3/userguide/build_environment.html#gradle_system_properties
                  > PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
   > Could not resolve org.yaml:snakeyaml:1.29.
     Required by:
         project : > com.huawei.ohos:hap:3.1.5.0
      > Could not resolve org.yaml:snakeyaml:1.29.
         > Could not get resource 'https://repo.huaweicloud.com/repository/maven/org/yaml/snakeyaml/1.29/snakeyaml-1.29.pom'.
            > Could not GET 'https://repo.huaweicloud.com/repository/maven/org/yaml/snakeyaml/1.29/snakeyaml-1.29.pom'.
               > The server may not support the client's requested TLS protocol versions: (TLSv1.2, TLSv1.3). You may need to configure the client to allow other protocols to be used. See: https://docs.gradle.org/7.3/userguide/build_environment.html#gradle_system_properties
                  > PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
   > Could not resolve com.alibaba:fastjson:1.2.83.
     Required by:
         project : > com.huawei.ohos:hap:3.1.5.0
         project : > com.huawei.ohos:decctest:1.2.7.20
         project : > com.huawei.ohos:hap:3.1.5.0 > com.huawei.deveco:sdk-hos-core:3.1.0.400-release > com.huawei.deveco:sdk-core:3.1.0.400-release
      > Could not resolve com.alibaba:fastjson:1.2.83.
         > Could not get resource 'https://repo.huaweicloud.com/repository/maven/com/alibaba/fastjson/1.2.83/fastjson-1.2.83.pom'.
            > Could not GET 'https://repo.huaweicloud.com/repository/maven/com/alibaba/fastjson/1.2.83/fastjson-1.2.83.pom'.
               > The server may not support the client's requested TLS protocol versions: (TLSv1.2, TLSv1.3). You may need to configure the client to allow other protocols to be used. See: https://docs.gradle.org/7.3/userguide/build_environment.html#gradle_system_properties
                  > PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

gradle的.cache和Android Studio的共用导致的,单独弄个离线的就好了 自己下载个个gradle:gradle.org/releases/ 指定gradle路径,重新编译就好了。 image.png