No Cached Version Available for Offline Mode

Gradle sync failed: No cached version available for offline mode

It seams like gradle maps its cached dependencies using their absolute path, so moving .gradle directory into another pc will not work if the full path of the parent differs between the two computers. to solve the problem i managed to change the path of my gradle home on the online pc into "C:\Program Files\android.gradle" by setting the environment variable GRADLE_USER_HOME to that path. Then started android studio and built my application to cache dependencies. After that i was able to successfully copy .gradle folder from the online machine into the offline one by placing it in the same path as the online machine gradle path and pointing to that path through the EV GRADLE_USER_HOME.

No Cached Version Gradle Plugin Available for offline mode

As per the Android Studio 3.6 release notes:

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

Could not download gradle-4.0.0.jar No cached version available for offline mode

You need to disable gradle offline mode. This is how you can do it in andorid studio 4.1

Toggle gradle offline mode

No cached version of gradle

In my case I also had an additional "offline switch" to the one in Gradle.

Go to:

File > Settings > Build, Execution, Deployment > Compiler

There I've removed the --offline in Command-line Options.
Earlier I was trying to speed up Android Studio a bit and this was one of the changes I had made.

Everything was fine after a restart then (and I have re-enabled both offline parts).



Related Topics



Leave a reply



Submit