Could not resolve all dependencies for configuration ':classpath'

后端 未结 23 1415
离开以前
离开以前 2020-12-01 04:27

I cant seem to get build tools for the latest gradle at all. I suspect its something to do with proxy setting for gradle. I have had a good look online but still cant seem t

相关标签:
23条回答
  • 2020-12-01 04:45

    I had a same problem and I fix it with the following steps:

    1. check the event log and if you see the errors like "cash version is not available for the offline mode" follow the steps.
    2. click on View => Gradle then new window will open.
    3. click on the WIFI icon and then sync the Gradle. "if you see different errors from what I mentioned in number one, please go to the file -> project structure -> and there is suggestion"
    0 讨论(0)
  • 2020-12-01 04:47

    you should have gradle.properties file defined for the build with proxy settings so that gradle knows how to use http connection

    # This file contains the basics for Maven Version control and will be used by the Artifactory Release management
    # These settings are for the root project and all sub-projects in this application
    releaseVersion=1.0.0-SNAPSHOT
    releaseGroup=com.xx.xx.xx
    artifactory_user=
    artifactory_password=
    artifactory_contextUrl=https://artifactory.xxxx.com/artifactory/
    systemProp.http.proxyHost=proxy.xxx.com
    systemProp.http.proxyPort=8080
    systemProp.https.proxyHost=proxy.xxx.com
    systemProp.https.proxyPort=8080
    systemProp.http.nonProxyHosts=*.xxx.com|localhost|*.int.targoe.com
    org.gradle.java.home=C:\\Program Files (x86)\\Java\\jdk1.8.0_121
    
    0 讨论(0)
  • 2020-12-01 04:49

    I got the same problem. Just use File->INVALIDATE CACHES AND RESTART

    0 讨论(0)
  • 2020-12-01 04:50

    I was facing the same issue, it was because of the cache. You just need to follow these Steps:

    1. Go to File -> Invalidate Caches / Restart
    2. After restarting Android Studio, connect your PC to a good network.
    3. Go to build and choose rebuild, and Android Studio will automatically download the missing files for the project
    0 讨论(0)
  • 2020-12-01 04:51

    The solution is in your build.gradle change this block:

    allprojects {
      repositories {
        jcenter()
        google()
      }
    }
    

    to google in first position :

    allprojects {
      repositories {
        google()
        jcenter()
      }
    }
    
    0 讨论(0)
  • 2020-12-01 04:51

    If adding google() into your build.gradle doesn't work try adding it at first place in your repositories section of node_modules/YOUR_PACKAGE/android/build.gradle file.

    0 讨论(0)
提交回复
热议问题