Android studio gradle is failing with error: Could not get resource 'https://jcenter.bintray.com/…/"

Viewed 1817

I am getting issue when I am syncing the project in Android Studio. The problem was not there till last week. Initially I thought it might be the network issue. But I tried in mobile hotspot, office VPN etc. The error says:

 > Could not resolve org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.72.
         > Could not get resource 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.3.72/kotlin-stdlib-jdk8-1.3.72.pom'.
            > Could not GET 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.3.72/kotlin-stdlib-jdk8-1.3.72.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 org.ow2.asm:asm:7.0.
     Required by:
         project : > com.android.tools.build:gradle:4.0.1
         project : > com.android.tools.build:gradle:4.0.1 > com.android.tools.build:builder:4.0.1
      > Could not resolve org.ow2.asm:asm:7.0.
         > Could not get resource 'https://jcenter.bintray.com/org/ow2/asm/asm/7.0/asm-7.0.pom'.
            > Could not GET 'https://jcenter.bintray.com/org/ow2/asm/asm/7.0/asm-7.0.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 org.ow2.asm:asm-analysis:7.0.
     Required by:
         project : > com.android.tools.build:gradle:4.0.1
      > Could not resolve org.ow2.asm:asm-analysis:7.0.
         > Could not get resource 'https://jcenter.bintray.com/org/ow2/asm/asm-analysis/7.0/asm-analysis-7.0.pom'.
            > Could not GET 'https://jcenter.bintray.com/org/ow2/asm/asm-analysis/7.0/asm-analysis-7.0.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 org.ow2.asm:asm-commons:7.0.
     Required by:
         project : > com.android.tools.build:gradle:4.0.1
         project : > com.android.tools.build:gradle:4.0.1 > com.android.tools.build:builder:4.0.1
      > Could not resolve org.ow2.asm:asm-commons:7.0.
         > Could not get resource 'https://jcenter.bintray.com/org/ow2/asm/asm-commons/7.0/asm-commons-7.0.pom'.
            > Could not GET 'https://jcenter.bintray.com/org/ow2/asm/asm-commons/7.0/asm-commons-7.0.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 org.ow2.asm:asm-util:7.0.
     Required by:
         project : > com.android.tools.build:gradle:4.0.1
         project : > com.android.tools.build:gradle:4.0.1 > com.android.tools.build:builder:4.0.1
      > Could not resolve org.ow2.asm:asm-util:7.0.
         > Could not get resource 'https://jcenter.bintray.com/org/ow2/asm/asm-util/7.0/asm-util-7.0.pom'.
            > Could not GET 'https://jcenter.bintray.com/org/ow2/asm/asm-util/7.0/asm-util-7.0.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.protobuf:protobuf-java:3.10.0.
     Required by:
         project : > com.android.tools.build:gradle:4.0.1
         project : > com.android.tools.build:gradle:4.0.1 > com.android.tools.build:builder:4.0.1 > com.android.tools:sdk-common:27.0.1
         project : > com.android.tools.build:gradle:4.0.1 > com.android.tools.build:builder:4.0.1 > com.android.tools.analytics-library:protos:27.0.1
         project : > com.android.tools.build:gradle:4.0.1 > com.android.tools.build:builder:4.0.1 > com.android.tools.analytics-library:tracker:27.0.1
         project : > com.android.tools.build:gradle:4.0.1 > com.android.tools.build:aaptcompiler:4.0.1 > com.android.tools.build:aapt2-proto:4.0.1-6197926
      > Could not resolve com.google.protobuf:protobuf-java:3.10.0.
         > Could not get resource 'https://jcenter.bintray.com/com/google/protobuf/protobuf-java/3.10.0/protobuf-java-3.10.0.pom'.
            > Could not GET 'https://jcenter.bintray.com/com/google/protobuf/protobuf-java/3.10.0/protobuf-java-3.10.0.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.protobuf:protobuf-java-util:3.10.0.
     Required by:
         project : > com.android.tools.build:gradle:4.0.1
      > Could not resolve com.google.protobuf:protobuf-java-util:3.10.0.
         > Could not get resource 'https://jcenter.bintray.com/com/google/protobuf/protobuf-java-util/3.10.0/protobuf-java-util-3.10.0.pom'.

What I have tried to fix:

  1. Tried network (wifi to mobile hotspot).
  2. Added this: maven { url "http://jcenter.bintray.com"}

I understood that issue is due to jcenter. But what I need to do extra and why, I am not understanding. Some places I saw they are asking to do this: You need import jcenter's cerficate into your java keystore. But I am not sure how to get that certifcate.

The most bizarre thing is why I am getting the issue all of sudden.

I am using Android studio 4.0.1.

Thanks, Arindam.

0 Answers
Related