Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio 3.0.1 gradle build pkix pathbuilding failed

Tags:

java

android

I have created a new project in android studio 3.0.1 setup the proxy settings of company and added the self sighned certificate unser server sertificates. When I try to build the following error is listed and the build fails.

Error:

Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.android.support:appcompat-v7:26.1.0.

Could not resolve com.android.support:appcompat-v7:26.1.0.
Required by:
    project :app
 > Could not resolve com.android.support:appcompat-v7:26.1.0.
    > Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/support/appcompat-v7/26.1.0/appcompat-v7-26.1.0.pom'.
          > Could not GET 'https://dl.google.com/dl/android/maven2/com/android/support/appcompat-v7/26.1.0/appcompat-v7-26.1.0.pom'.
                   > sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
                               > PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
                                              > unable to find valid certification path to requested target

Could somebody help me?

like image 316
ninjaxelite Avatar asked Dec 06 '17 15:12

ninjaxelite


2 Answers

Solved this by adding the self signed certificate of my company to the cacerts file of Android Studio. The cacerts file is located here: C:\Program Files\Android\Android Studio\jre\jre\lib\security\cacerts

I have also added the proxy details for http/https to gradle.properties.

like image 129
ninjaxelite Avatar answered Oct 06 '22 05:10

ninjaxelite


Yeah, I have resolved the issue by changing the WiFi network connection. do any of the following step 1. connect to other or Mobile network(use hotspot) and reconnect to WiFi network 2. Reset your wifi network in laptop

like image 42
Naresh Palle Avatar answered Oct 06 '22 04:10

Naresh Palle