Error in android Studio 3.0 when I sync gradle. Error:Cause: unable to find valid certification path to requested target

4.4k views Asked by At

I got the following Error in android Studio 3.0,when I sync gradle.

Gradle 'Projectname' project refresh failed.

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

2

There are 2 answers

0
Haileapp On

Delete jcenter() and Change The Repositories in the build.gradle file to the following format:

repositories {
    maven {
        url "http://jcenter.bintray.com"
    }
}
0
Moonsoo Kim On

I had faced exact same issue to my existing projects after upgrading Android Studio 3.0.
I was able to resolve it with changing gradle script like below.

build.gradle

buildscript {
    dependencies {
        classpath 'com.android.tools.build:gradle:**3.0.0**'
    }
}

gradle-wrapper.properties

distributionUrl=https\://services.gradle.org/distributions/**gradle-4.1-all.zip**

I hope this is helpful for you

Note: My Android Studio info

Android Studio 3.0
Build #AI-171.4408382, built on October 21, 2017
JRE: 1.8.0_152-release-915-b01 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 7 6.1