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
How to Find Out Carrier's Name in Android
How to Get The Dimensions of a Drawable in an Imageview
Fragmentmanager Is Already Executing Transactions. When Is It Safe to Initialise Pager After Commit
How to Place App Icon on Launcher Home Screen
Cannot Find R.Layout.Activity_Main
Android Studio: "Use Default Gradle Wrapper" VS. "Use Customizable Gradle Wrapper"
Custom Listview Fast Scrollbar in Android
Mobile Chrome Fires Resize Event on Scroll
Release APK Not Updating with JavaScript Code
Retain The Fragment Object While Rotating
How to Find The Amount of Free Storage (Disk Space) Left on Android
Android Active Link of Url in Textview
How to Fix Android Studio Getting Stuck Executing Gradle Tasks
Just Upgraded My Os X to Yosemite, Android Device Chooser Not Showing Device - What to Do