I got the following Error in android Studio 2.2.3 when I sync gradle.
Error:Cause: unable to find valid certification path to requested target
"Unable to find valid certification path to requested target"
If you are getting this message, you probably are behind a Proxy on your company, which probably is signing all request certificates with your company root CA certificate, this certificate is trusted only inside your company, so Android Studio cannot validate any certificate signed with your company certificate as valid, so, you need to tell Android Studio to trust your company certificate, you do that by adding your company certificate to Android Studio truststore.
(I'm doing this on macOS, but should be similar on Linux or Windows)
On the popup window, to save the root certificate as a file, make sure to select the top level of the certificates chain (the root cert) and drag the certificate image to a folder/directory on your disk drive. It should be saved as a file as, for example: my-root-ca-cert.cer, or my-root-ca-cert.pem
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
In Android Studio open File -> Project Structure -> SDK Location -> JDK Location
Copy the path of JDK Location, and open the Terminal, and change your directory to that path, for example, execute:
cd /Applications/Android\ Studio.app/Contents/jre/jdk/Contents/Home/
(don't forget to scape the whitespace, "\ ")
Now, to import the certificate to the truststore, execute:
./bin/keytool -importcert -file /path/to/your/certificate/my-root-ca-cert.cer -keystore ./jre/lib/security/cacerts -storepass changeit -noprompt
File -> Invalidate Caches / Restart
Done, you should be able to build your project now.
I just encountered the similar problem and found a series of steps did help me. Of course few of them is to Change the network to a stronger,better one.or if you have only one network then try Reconnecting to the network and then simply INVALIDATE/RESTART your android studio. If it still shows the error you need to add the "maven" in repositories and point it out to the link as shown below: maven { url "http://jcenter.bintray.com"}
Finally,Go to *File *Settings *Build,Execution and deployment *Gradle *Android Studio --------And check Enable maven repository option.
After that simply clean and rebuild your APP and you will be good to go.
You are using older version of libraries.
compile 'com.android.support:appcompat-v7:25.2.0'
compile 'com.android.support:design:25.2.0'
compile 'com.android.support:palette-v7:25.2.0'
compile 'com.google.firebase:firebase-messaging:10.2.0'
I faced the same issue, but fixed it by adding
maven { url "http://jcenter.bintray.com"}
in the project Level Gradle File
buildscript {
repositories {
jcenter()
maven { url "http://jcenter.bintray.com"}
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.google.gms:google-services:3.0.0'
}
}
allprojects {
repositories {
mavenCentral()
jcenter{ url "http://jcenter.bintray.com/" }
maven { url "https://jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I missed this problem after update studio and gradle ,in the log file tips me some maven store has certificate problem.
I tried restart statudio as somebody suggestion but dose work; and somebody said we should set the jre environment ,but I doesn't know how to set it on Mac . So I tried restart Mac. and start studio I found this tips.
so the problem is floating on the surface: solution: first step: restart computer ,there are too many problem after android studio update . second step:use the old gradle tool OR download the *pom and jar ,put in correct folder.
The error is is because of your network restriction that does not allow to sync the project from "http://jcenter.bintray.com", No need play with the IDE (Android Studio).