Android Studio 3.0.1 gradle build pkix pathbuilding failed

ninjaxelite :

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?

ninjaxelite :

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.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=460166&siteId=1