androidandroid-studioucrop

"PKIX path building failed" after updating to AS 3.3


This is what I get in Build tab:

* 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

project 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
}

Solution

  • So the solution is to use embedded JDK which is recommended way.

    File → Project Structure → SDK Location → Use embedded JDK