I have the following configuration:
Gradle build started to report an error in all my projects, so I guess it's not related to a specific project config (build.gradle etc.).
The same projects are building and working normally on the same Android Studio, Gradle and JDK versions on Windows.
Steps I already tried but didn't help:
Error details:
Gradle sync failed: Cause: unable to find valid certification path to requested target
FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring root project 'name-of-the-project'. > Could not resolve all artifacts for configuration ':classpath'. > Could not resolve com.android.tools.build:gradle:4.1.1. Required by: project : > Could not resolve com.android.tools.build:gradle:4.1.1. > Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.1.1/gradle-4.1.1.pom'. > Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.1.1/gradle-4.1.1.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.google.gms:google-services:4.3.4. Required by: project : > Could not resolve com.google.gms:google-services:4.3.4. > Could not get resource 'https://dl.google.com/dl/android/maven2/com/google/gms/google-services/4.3.4/google-services-4.3.4.pom'. > Could not GET 'https://dl.google.com/dl/android/maven2/com/google/gms/google-services/4.3.4/google-services-4.3.4.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.google.firebase:firebase-crashlytics-gradle:2.4.1. Required by: project : > Could not resolve com.google.firebase:firebase-crashlytics-gradle:2.4.1. > Could not get resource 'https://dl.google.com/dl/android/maven2/com/google/firebase/firebase-crashlytics-gradle/2.4.1/firebase-crashlytics-gradle-2.4.1.pom'. > Could not GET 'https://dl.google.com/dl/android/maven2/com/google/firebase/firebase-crashlytics-gradle/2.4.1/firebase-crashlytics-gradle-2.4.1.pom'. > sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
It seems like it is a network problem, but I tried to use different connection solutions with different providers, with and without VPN.
All mentioned files are accessible and I can download them from terminal using wget
wget https://dl.google.com/dl/android/maven2/com/google/gms/google-services/4.3.4/google-services-4.3.4.pom --2021-03-04 12:42:32-- https://dl.google.com/dl/android/maven2/com/google/gms/google-services/4.3.4/google-services-4.3.4.pom Resolving dl.google.com (dl.google.com)... 216.58.214.206 Connecting to dl.google.com (dl.google.com)|216.58.214.206|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 1576 (1,5K) [application/octet-stream] Saving to: ‘google-services-4.3.4.pom.1’ google-services-4.3.4.pom.1 100%[=====================================================================================>] 1,54K --.-KB/s in 0s 2021-03-04 12:42:32 (11,3 MB/s) - ‘google-services-4.3.4.pom.1’ saved [1576/1576]
I've been stuck with the exact same bug for several days, and like you I tried pretty much everything.
Finally I noticed something in Android Studio. I went to the Http Proxy preference tab and I saw a message saying
You have JVM property "https.proxyHost" set to "localhost"....
I tried to override this value by putting the line :
systemProp.https.proxyHost=
In my project gradle.properties file and tadaaa ! It works, I don't really understand what happened though...
Hoping to be helpful ;)
After additional research... for some reason, MacOS network proxy settings were changed and that was the reason for the warning Android Studio made:
You have JVM property "https.proxyHost" set to "localhost"....
To fix this, go to
System Preferences / Network / Advanced (for network you are using) / Proxy
and unselect Web Proxy and Secure Web Proxy
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