Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio : Error:Cause: unable to find valid certification path to requested target

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' }  }
like image 837
Raulp Avatar asked Nov 30 '17 08:11

Raulp


People also ask

Do I need a non-trusted certificate for Android Studio?

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.

What does “unable to find valid certification path” and “PKIX path building failed” mean?

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.

How to add SSL certificate to Android Studio project?

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):

How to import certificates from Android Studio to trusstore?

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.


2 Answers

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.

like image 191
Abdul Rafay Avatar answered Sep 20 '22 04:09

Abdul Rafay


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.

like image 31
mostafa ahmed Avatar answered Sep 18 '22 04:09

mostafa ahmed