更新到AS 3.3后,“ PKIX路径构建失败”

时间:2019-01-19 08:19:17

标签: android android-studio ucrop

这是我在“构建”标签中看到的:

* What went wrong:
Could not determine the dependencies of task ':app:compileDebugAidl'.
> Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
   > Could not resolve com.github.chrisbanes:PhotoView:2.3.0.
     Required by:
         project :app
      > Could not resolve com.github.chrisbanes:PhotoView:2.3.0.
         > Could not get resource 'https://jitpack.io/com/github/chrisbanes/PhotoView/2.3.0/PhotoView-2.3.0.pom'.
            > Could not GET 'https://jitpack.io/com/github/chrisbanes/PhotoView/2.3.0/PhotoView-2.3.0.pom'.
               > sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
   > Could not resolve com.github.yalantis:ucrop:2.2.2.
     Required by:
         project :app
      > Could not resolve com.github.yalantis:ucrop:2.2.2.
         > Could not get resource 'https://jitpack.io/com/github/yalantis/ucrop/2.2.2/ucrop-2.2.2.pom'.
            > Could not GET 'https://jitpack.io/com/github/yalantis/ucrop/2.2.2/ucrop-2.2.2.pom'.
               > sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

项目build.gradle:

buildscript {
    repositories {
        jcenter()
        google()
        maven { url 'https://maven.fabric.io/public' }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.0'
        classpath 'com.github.ben-manes:gradle-versions-plugin:0.20.0'
        classpath 'io.fabric.tools:gradle:1.+'
        classpath 'com.google.gms:google-services:4.2.0'
    }
}

allprojects {
    repositories {
        jcenter()
        google()
        maven { url "https://jitpack.io" }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

1 个答案:

答案 0 :(得分:1)

因此解决方案是使用推荐的嵌入式JDK。

文件→项目结构→SDK位置→使用嵌入式JDK