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
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.
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.
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
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
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
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:
Gradle
, then click Enter