No cached version of gradle

I get this error while synchronizing Gradle. I'm pretty new, so I can’t understand what exactly is the problem?

Error: There is no cached version of com.android.tools.build:gradlemail.10.1 for offline mode.

When I Setting->Gradle on Setting->Gradle , I turn off offline mode and use the default wrapper.

+7
source share
5 answers

In my case, I also had an additional “standalone switch” to the one that was in Gradle.

Switch to:

 File > Settings > Build, Execution, Deployment > Compiler 

There I removed --offline in the Command-line Options . I used to try to speed things up a bit with Android Studio, and that was one of the changes I made.

After the reboot, everything was fine (and I turned on both autonomous parts again).

+18
source

This problem occurs if IDE mode is enabled offline, and let the IDE update your build file using the gradle plugin 0.10.1 (which is necessary for the new version of AS. Since you never had a build with this version, it cannot be found in offline cache.

Go to the File-> Settings → Gradle menu (in the "Project Settings at the Top" section) and disable the check before working offline (the "Global gradle settings" section at the bottom). Now it can download the version with the next build, and then you can use the offline mode again if you want.

+5
source

Disable offline mode to resolve this error.

In Android studio:

File → Other Settings → Default Settings → Build,Execution,Deployment → Build Tools → Gradle

Then uncheck " Offline work and repeat the synchronization.

Hope your problem is resolved.

+2
source

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

This works for me.

I updated the version of Gradle 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 

in

 distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip 
0
source

I thought I should post the latest update, where you can find the option to disable offline work in IntelliJ.

It is under your preferences -> Build, Execution, Deployment

Uncheck "Offline work" and everything will be fine

enter image description here

0
source

Source: https://habr.com/ru/post/970631/


All Articles