Where to get more information about this error in Android Studio
Error:Cause: unable to find valid certification path to requested target
I dont know from where it is coming and what to look for?
Below is the snippet from my Build.gradle.
buildscript {
repositories {
jcenter() {
url "http://jcenter.bintray.com/"
}
// mavenCentral()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
classpath 'io.fabric.tools:gradle:1.+'
}
}
allprojects {
repositories {
jcenter() {
url "http://jcenter.bintray.com/"
}
// mavenCentral()
maven { url 'https://maven.fabric.io/public' }
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
jcenter() {
url "http://jcenter.bintray.com/"
}
maven { url 'https://maven.fabric.io/public' } }
It really shouldn't be needed given that Android Studio has that nice tempting "Accept non-trusted certificates automatically" tickbox, but you still have to do these steps. This should be an answer. Thanks Carlos! @Keab42 Step 3 is necessary.
Here is my solution for key phrases of the messages: “unable to find valid certification path” and “PKIX path building failed“. These phrases are shown when a SSL certification file can not be found.
On Android Studio open Preferences -> Tools -> Server Certificates , on the box Accepted certificates click the plus icon ( + ), search the certificate you saved previously and click Apply and OK Third, you need to add the certificate to the Android Studio JDK truststore (Gradle use this JDK to build the project, so it's important):
Open the truststore of Android Studio in path JDKPATH/jre/lib/security/cacerts with the Keystore Explorer tool Keystore Exlorer with password "changeit" Import the exported certs into the trusstore starting with the root certificate of you company and go the step 6. In the most cases this will do the trick.
I hope resolved that issue, may be my answer will help others. This issue i faced because of Charles proxy, so the solution is just close the charles proxy tool and Android Studio also, then first open Android Studio it will work fine.
Check your internet connection. This happened to me when I was connected to a corporate restricted internet.
Connect to a non-restricted internet solved my problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With