No cached version of gradle

后端 未结 16 2446
悲&欢浪女
悲&欢浪女 2020-11-28 15:21

I am getting this error when syncing gradle. I am pretty new to gradle so can\'t figure out what is the problem exactly?

Error:No cached version of co

相关标签:
16条回答
  • 2020-11-28 15:41

    In Android Studio 3.6 (or above) Click on the Gradle Button Which is at right side, it will open up small window, here click on the “Toggle Offline Mode” icon for enable or disable toggle. See below image for reference.

    • Shortcut key can also be set from settings as one is being shewn in image below that I've set.

    0 讨论(0)
  • 2020-11-28 15:43

    Disable offline mode to solve this error.

    In Android studio:

    File -> Other Settings -> Default Settings -> Build,Execution,Deployment -> Build Tools -> Gradle

    Then uncheck Offline work and sync again.

    Hope your issue will resolved.

    0 讨论(0)
  • 2020-11-28 15:44

    I have different solutions since none of the above solution worked for me I don't know why (in macOS)

    To disabled the offline mode since com.google.android.gms:play-services-base:17.1.0 No cached version available for offline mode

    STEP: 1 Just make changes like

    com.google.android.gms:play-services-base:17.1.1 in the gradle

    STEP: 2 Which will pop Sync Now option

    press Sync Now

    STEP: 3 then in your build will appear (Disable offline mode and Sync)

    Press Disabled offline mode and Sync and the offline mode will be disabled

    STEP: 4 Change com.google.android.gms:play-services-base:17.1.1 to com.google.android.gms:play-services-base:17.1.0 then Sync again

    It worked for me hope it helps you

    0 讨论(0)
  • 2020-11-28 15:45

    I had the same problem in Android Studio v3.2.1.

    This is working for me.

    I updated Gradle version in build.gradle

     dependencies {
            classpath 'com.android.tools.build:gradle:3.2.1'//same as Android Studio vesion           
     }
    

    and changed distributionUrl in gradle-wrapper.properties

    distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
    

    to

    distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
    
    0 讨论(0)
  • 2020-11-28 15:46

    I’ve also encountered this issue and from Android Studio 3.6 the setting changed and can be found in another window. As stated here:

    New location to toggle Gradle's offline mode To enable or disable Gradle's offline mode, first select View > Tool Windows > Gradle from the menu bar. Then, near the top of the Gradle window, click Toggle Offline Mode Gradle offline button in the Gradle panel.

    Here are the release notes: https://developer.android.com/studio/releases/#3.6-gradle-offline-ui

    0 讨论(0)
  • 2020-11-28 15:49

    I have Android Studio 3.6 Beta 1, so there is no checkBox offline mode in Gradle settings.

    If somebody can't find it as well, here is the answer:

    1. Ctrl + Shift + "A"
    2. Type Gradle, then click Enter

    You can toggle offline mode now

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