android – no cached version available for offline mode-ThrowExceptions

Exception or error:

At office, I am behind a proxy. The internet access is restricted.

So I performed a gradle sync at home and copied the folder “.gradle” present at C:\Users\username.gradle from my home PC to the same location on my office PC.

Now on my office PC, I set gradle in Android Studio to “Work Offline” but still whenever I try to perform a gradle sync, I get an error stating

Error: Could not download google-services.jar ( No cached version available for offline mode

However on digging through the “.gradle” folder I was able to locate the google-service.jar file at


I am not sure how to proceed. Please help.

How to solve:

I had to dig for this a long time in the 2019.2 version. This option has moved in the UI. It is now in the toolbar of the gradle tools:

intellij gradle toolbar

see JetBrains documentation at


This Error occurs when in your Android Studio’s Gradle Tools Offline Mode option is Enabled.

enter image description here

When Enabled it lookes like this.

enter image description here

To fix it, you can Disable mode by clicking on the option shown in below screenshot.

enter image description here


Maybe helps someone. Just remove --offline in “Command-line Options:”

enter image description here


It seems that in newer versions of IntelliJ (I am on 2018.1) you may need to uncheck the Offline checkbox in Gradle preferences.

Gradle Prefences Screenshot


You need to re-enable your gradle online mode

Google changed the location of doing this…
After the latest version as at this time i am typing this answer, which is version below
Android Studio 3.6.1
built on February 27, 2020

I have sent a message to the them so Google changes this in next update..Cos the new location confuses the Software engineers who are used to the old way of doing it…
But for now follow these clear 2 steps to find it and toggle it Online or Offline easily..

  1. Just Go to the top-right hand corner of your SDK and click the vertical Gradle tab as circled in red in the my picture below

  2. Then you Click this icon (which looks like a symbol in an electrical schematic circuit) on the gradle table that comes out.. As Circled in Red in my picture below.. Image of what you must toggle


Just for reference 2019.1 Ultimate IntelliJ, go to Gradle -> Settings (a top-rightmost icon) -> Uncheck the Offline work in Global Gradle settings.

enter image description here

Gradle Tab not presented, go to View -> Tool Windows -> Gradle to show it first.


Try running gradle with the –debug flag, in addition to the –offline flag. That will tell you exactly where it’s looking for the files.

One possible reason for the error is that the path of the .gradle folder is different between your home and office PC, possibly because your username is different on each machine. The .gradle cache uses absolute paths (see .gradle/caches/modules-2/metadata-2.16/artifact-at-repository.bin for an example). This is a documented Gradle issue: If possible, use the same GRADLE_HOME at home and work to resolve the issue.


I’m using android studio in MacBook

step 1 – Go to preferences by clicking android studio on the left
uppermost corner.

step 2 – Go inside Build,Execution,Deployment.

step 3 – Finally select Gradle.

step 4 – then, uncheck offline work. Click apply then ok.

step 5- lastly try to sync once again.

Hope this will work because it works for me.


How to configure gradle to work "offline" (using cached dependencies)

Uncheck the ‘Offline work’ under the Global Gradle settings fixes my issue.

Leave a Reply

Your email address will not be published. Required fields are marked *