Could not resolve all files for configuration ':classpath'

13,195

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' }
    }
}
Share:
13,195
Lavaraju
Author by

Lavaraju

Updated on June 28, 2022

Comments

  • Lavaraju
    Lavaraju almost 2 years

    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
    
  • Lavaraju
    Lavaraju over 5 years
    i followed this but getting same issue! What went wrong: A problem occurred configuring root project 'storehealthrn'. > Could not resolve all files for configuration ':classpath'. > Could not resolve com.android.tools.build:gradle:3.2.1.
  • LumbusterTick
    LumbusterTick over 4 years
    Im the one who upvoted it. But I did not ask the question .