# Couldnt resolve the gradle sync ERROR: Cause: unable to find valid certification path to requested target

**URL:** <https://discuss.gradle.org/t/couldnt-resolve-the-gradle-sync-error-cause-unable-to-find-valid-certification-path-to-requested-target/34563>\
**Category:** scans.gradle.com\
**Created:** [January 16, 2020, 5:17pm UTC](https://discuss.gradle.org/t/couldnt-resolve-the-gradle-sync-error-cause-unable-to-find-valid-certification-path-to-requested-target/34563 "2020-01-16T17:17:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rbeatajane](https://avatars.discourse-cdn.com/v4/letter/r/bbe5ce/32.png) [@rbeatajane](https://discuss.gradle.org/u/rbeatajane)\
**Post date:** [January 16, 2020, 5:17pm UTC](https://discuss.gradle.org/t/couldnt-resolve-the-gradle-sync-error-cause-unable-to-find-valid-certification-path-to-requested-target/34563/1 "2020-01-16T17:17:53Z")

</div>

I am getting a build error “ERROR: Cause: unable to find valid certification path to requested target”. I have deleted the expired certificates from the settings-\>certificate page. Also, I have updated the gradle build with maven { url “[http://jcenter.bintray.com](http://jcenter.bintray.com/)”}. I am still getting the build error. Please help in fixing the same. I followed the resolution provided in the [Error:Cause: unable to find valid certification path to requested target](https://stackoverflow.com/questions/42415666/errorcause-unable-to-find-valid-certification-path-to-requested-target) , but no luck.

**Gradle.build file :**

```gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        google()
        jcenter()
        maven { url "http://jcenter.bintray.com"}
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.3'
        classpath 'com.google.gms:google-services:3.0.0'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        //jcenter()
        mavenCentral()
        jcenter{ url "http://jcenter.bintray.com/" }
        maven { url "https://jitpack.io" }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

```

**Build Error :**

```gradle
    org.gradle.internal.exceptions.LocationAwareException: A problem occurred configuring root project 'My Application'.
        at org.gradle.initialization.exception.DefaultExceptionAnalyser.transform(DefaultExceptionAnalyser.java:99)
        at org.gradle.initialization.exception.DefaultExceptionAnalyser.collectFailures(DefaultExceptionAnalyser.java:62)
        at org.gradle.initialization.exception.MultipleBuildFailuresExceptionAnalyser.transform(MultipleBuildFailuresExceptionAnalyser.java:47)
......
    Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
        ... 83 more
    Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
        ... 83 more

```

---

<div class="post-metadata">

**Author:** ![JLLeitschuh](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/jlleitschuh/32/5788_2.png) [@JLLeitschuh](https://discuss.gradle.org/u/JLLeitschuh)\
**Post date:** [January 16, 2020, 5:20pm UTC](https://discuss.gradle.org/t/couldnt-resolve-the-gradle-sync-error-cause-unable-to-find-valid-certification-path-to-requested-target/34563/2 "2020-01-16T17:20:29Z")

</div>

Hi @rbeatajane,

Your build needs to use HTTPS instead of HTTP in your `repositories` blocks.

JCenter dropped support for HTTP on January 13th, 2020.

You can read more about it here:  
[https://medium.com/@jonathan.leitschuh/update-want-to-take-over-the-java-ecosystem-all-you-need-is-a-mitm-d069d253fe23?source=friends\_link&sk=8c8e52a7d57b98d0b7e541665688b454](https://medium.com/@jonathan.leitschuh/update-want-to-take-over-the-java-ecosystem-all-you-need-is-a-mitm-d069d253fe23?source=friends_link&sk=8c8e52a7d57b98d0b7e541665688b454)
