别误导了!sun.security.validator.ValidatorException: PKIX path building failed的处理方法

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':meeting:checkDebugDuplicateClasses'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
   > Duplicate class android.support.v4.app.LoaderManager found in modules loader-28.0.0-runtime (com.android.support:loader:28.0.0) and support-fragment-27.1.0-runtime (com.android.support:support-fragment:27.1.0)
     Duplicate class android.support.v4.app.LoaderManager$LoaderCallbacks found in modules loader-28.0.0-runtime (com.android.support:loader:28.0.0) and support-fragment-27.1.0-runtime (com.android.support:support-fragment:27.1.0)
     Duplicate class android.support.v4.app.LoaderManagerImpl found in modules loader-28.0.0-runtime (com.android.support:loader:28.0.0) and support-fragment-27.1.0-runtime (com.android.support:support-fragment:27.1.0)
     Duplicate class android.support.v4.app.LoaderManagerImpl$LoaderInfo found in modules loader-28.0.0-runtime (com.android.support:loader:28.0.0) and support-fragment-27.1.0-runtime (com.android.support:support-fragment:27.1.0)
     Duplicate class android.support.v4.app.LoaderManagerImpl$LoaderObserver found in modules loader-28.0.0-runtime (com.android.support:loader:28.0.0) and support-fragment-27.1.0-runtime (com.android.support:support-fragment:27.1.0)
     Duplicate class android.support.v4.app.LoaderManagerImpl$LoaderViewModel found in modules loader-28.0.0-runtime (com.android.support:loader:28.0.0) and support-fragment-27.1.0-runtime (com.android.support:support-fragment:27.1.0)
     Duplicate class android.support.v4.app.LoaderManagerImpl$LoaderViewModel$1 found in modules loader-28.0.0-runtime (com.android.support:loader:28.0.0) and support-fragment-27.1.0-runtime (com.android.support:support-fragment:27.1.0)
     
     Go to the documentation to learn how to <a href="d.android.com/r/tools/classpath-sync-errors">Fix dependency resolution errors</a>.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':meeting:processDebugResources'.
> Could not resolve all files for configuration ':meeting:debugCompileClasspath'.
   > Could not resolve com.android.support:support-annotations:26.+.
     Required by:
         project :meeting
      > Failed to list versions for com.android.support:support-annotations.
         > Unable to load Maven meta-data from https://jcenter.bintray.com/com/android/support/support-annotations/maven-metadata.xml.
            > Could not get resource 'https://jcenter.bintray.com/com/android/support/support-annotations/maven-metadata.xml'.
               > Could not GET 'https://jcenter.bintray.com/com/android/support/support-annotations/maven-metadata.xml'.
                  > sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.7.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 57s

implementation 'com.android.support:support-annotations:26.+.'

改为:implementation 'com.android.support:support-annotations:'

android studio sun.security.validator.ValidatorException: PKIX path building 是一个常见的错误,通常在使用 Android Studio 进行网络请求出现。该错误表示无法验证服务器的证书。 PKIX(Public Key Infrastructure X.509)是一种公钥基础设施,用于验证和签发数字证书。当 Android Studio 发起网络请求时,它会尝试验证服务器的证书是否有效。如果证书无效或无法验证,就会抛出 sun.security.validator.ValidatorException: PKIX path building 错误。 这个错误通常有以下几种可能的原因和解决方法: 1. 证书过期或无效:检查服务器证书是否过期或无效。可以尝试使用其他工具(如浏览器)访问相同的服务器,以确认证书是否有效。 2. 证书链不完整:如果服务器证书的颁发机构(CA)证书不在 Android 系统的信任列表中,就会导致验证失败。解决方法是将 CA 证书添加到 Android Studio 的信任列表中。 3. 代理配置问题:如果你使用了代理服务器进行网络请求,可能需要在 Android Studio 中配置代理设置,以确保正确验证服务器证书。 4. 网络连接问题:有时候网络连接不稳定或存在防火墙等问题,可能导致验证失败。可以尝试使用其他网络环境或者关闭防火墙进行测试。 总结一下,sun.security.validator.ValidatorException: PKIX path building 错误通常是由于证书验证失败引起的。解决方法包括检查证书的有效性、添加缺失的 CA 证书、配置代理设置以及排除网络连接问题。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值