26

Error:No cached version of com.google.gms:google-services:1.4.0-beta3 available for offline mode. Disable Gradle 'offline mode' and sync project

I am facing this issue because I am working in offline mode in android studio. Can some body please tell me where is this cached file stored in my windows and from where I'll get this file so that I can separately download it and paste/keep it, and build my android project.

Rahul Sonone
  • 2,247
  • 1
  • 20
  • 36

7 Answers7

70

you can also do this:

Go to `File -> Other Settings -> Default Settings`

And open the

Build,Execution,Deployment

Then open the

Build Tools -> Gradle

Then uncheck Offline work on the right.

Click the OK button.

Then Rebuild the Project.

Siddharth
  • 8,842
  • 13
  • 79
  • 133
  • 1
    I know the "offline" option but for that particular package like "com.google.gms:google-services:1.4.0-beta3" I need to be online since it was not cached. – Rahul Sonone Jun 27 '16 at 11:07
  • 6
    In my case the offline option is unchecked by default. But still I am getting same error. – Suresh Kumar Jun 02 '18 at 17:26
  • 1
    For Mac, ```Android Studio -> Preferences -> Build,Execution,Deployment -> Gradle``` then uncheck "Offline work" – kuldipem Feb 12 '19 at 09:39
8

The Offline mode does not allow you to completely work offline. Its actually a GOOD cache mode. Whenever you add new dependencies, You HAVE to gradle sync the project, ATLEAST ONCE. Android studio has to download(then cache) the dependencies for the app to work. Once you sync the gradle files, then you can switch to offline mode, and you can work.

If you must work offline, then i would suggest determining all the dependencies you need in your application. Add them all at once and Gradle sync. Then switch to Offline mode.

UPDATE
If you are working behind a proxy network, then goto File-> Settings -> Under Appearence & Behavior -> Under System Settings -> HTTP Proxy -> Click on Manual proxy configuration, and add the neccessary details. Then goto your gradle.properties file which should contain sometyhing like this :

systemProp.http.proxyPassword=your_password
systemProp.http.proxyHost=host_Ip_address
systemProp.http.proxyUser=your_username
systemProp.http.proxyPort=port_number

Add this to your file, along with the above :

systemProp.https.proxyPassword=your_password
systemProp.https.proxyHost=host_Ip_address
systemProp.https.proxyUser=your_username
systemProp.https.proxyPort=port_number

These details can be found out from your browser's proxy settings.

Akhil Soman
  • 1,774
  • 12
  • 27
  • I have tried that but the issue is "Error:Connection timed out: connect. If you are behind an HTTP proxy, please configure the proxy settings either in IDE or Gradle." that's why I want to manually download the "google-services" and paste it at desired place – Rahul Sonone Jun 10 '16 at 12:08
  • Do you work behind a proxy network..? If you are, check my updated answer. – Akhil Soman Jun 10 '16 at 12:25
  • I have already done this even before posting this question. these are the proxy details and no need of any username and pwd systemProp.http.proxyHost=10.10.90.91 systemProp.http.proxyPort=8080 – Rahul Sonone Jun 13 '16 at 05:10
  • 1
    Did you add lines for https. If not then add the same code for https.==> systemProp.https.proxyHost=10.10.90.91 systemProp.https.proxyPort=8080 – Akhil Soman Jun 13 '16 at 10:07
  • Adding https proxy helped I had only added http proxy. Thank you – Rahul Sonone Jun 14 '16 at 07:30
8

Disable offline mode to solve this error.

In Android Studio Go:

File -> Setting -> Build, Execution, Deployment -> Gradle

Then Uncheck Ofline Work, Done.

Hasib Akter
  • 6,859
  • 2
  • 22
  • 34
4

Disable offline mode

  • Step 1: Goto File -> Settings -> Build, Execution, Deployment -> Gradle

  • Step 2: Uncheck checkbox of Offline Work.

  • Step 3: Click the Apply and Ok button.

  • Then click File -> Sync Project with Gradle Files and Rebuild the Project.

enter image description here

Taslim Oseni
  • 4,610
  • 10
  • 34
  • 50
Vishal Vaghasiya
  • 864
  • 1
  • 7
  • 15
  • in my case was a command-line options, take a look into it https://stackoverflow.com/a/59376069/2238515 – Almeida Dec 17 '19 at 14:14
0

Update te Gradle distribution, go to the oficial site https://services.gradle.org/distributions/ find the last, in this moment gradle-5.0-all.zip and download it, unzit this and configure the grandle path in Android studio S2s

0

If your Offline Work is Unchecked and If you still get this Error.

Do this:

File => Invalidate Caches/Restart

In my case also I had the same problem. Solved it using this.

Tejas
  • 380
  • 1
  • 2
  • 15
0

minSdkVersion can't be under 16, and it works. enter image description here

enter image description here

and download sdk tools google services,

click sdk manager and then click sdk tools and ** download google play services**

Unheilig
  • 15,690
  • 193
  • 65
  • 96