Lavaraju
Lavaraju

Reputation: 2808

Could not resolve all files for configuration ':classpath'

i am developing sample application in react-native , i faced this issue when i was run- android emulator my sdk tool version is 25 , but i don't know how it is getting this issue please let me suggestion.

> Could not resolve all files for configuration ':classpath'.
   > Could not resolve com.android.tools.build:gradle:3.1.0.
     Required by:
         project :
      > Could not resolve com.android.tools.build:gradle:3.1.0.
         > Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.1.0/gradle-3.1.0.pom'.
            > org.apache.http.ssl.SSLInitializationException: \Library\Java\Home\jre\lib\security\cacerts (The system cannot find the path specified)
      > Could not resolve com.android.tools.build:gradle:3.1.0.
         > Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.1.0/gradle-3.1.0.pom'.
            > org.apache.http.ssl.SSLInitializationException: \Library\Java\Home\jre\lib\security\cacerts (The system cannot find the path specified)
   > Could not resolve com.google.gms:google-services:3.2.0.
     Required by:
         project :
      > Could not resolve com.google.gms:google-services:3.2.0.
         > Could not get resource 'https://dl.google.com/dl/android/maven2/com/google/gms/google-services/3.2.0/google-services-3.2.0.pom'.
            > org.apache.http.ssl.SSLInitializationException: \Library\Java\Home\jre\lib\security\cacerts (The system cannot find the path specified)
      > Could not resolve com.google.gms:google-services:3.2.0.
         > Could not get resource 'https://jcenter.bintray.com/com/google/gms/google-services/3.2.0/google-services-3.2.0.pom'.
            > org.apache.http.ssl.SSLInitializationException: \Library\Java\Home\jre\lib\security\cacerts (The system cannot find the path specified)

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Upvotes: 12

Views: 39962

Answers (2)

Pradnya Choudhari
Pradnya Choudhari

Reputation: 394

Try Using

classpath 'com.android.tools.build:gradle:3.0.1'

and then clean and rebuild.

Upvotes: -1

touhid udoy
touhid udoy

Reputation: 4444

Your project can not access the urls to download the necessary libraries. This is most probably a gradle configuration issue.

Change your Project level build.gradle file like this:

buildscript {
repositories {

    google()
   jcenter()
}

dependencies {
    classpath 'com.android.tools.build:gradle:3.2.1'  
}

}

Update

If it doesn't work, try this too:

  repositories {
        jcenter()
        maven { url 'https://maven.google.com' }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0-alpha2'
        ...
    }
}

allprojects {
    repositories {
        jcenter()
        maven { url 'https://maven.google.com' }
    }
}

Upvotes: 4

Related Questions