Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No cached version of com.google.gms:google-services:1.x.x available for offline mode

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.

like image 494
Rahul Sonone Avatar asked Jun 10 '16 11:06

Rahul Sonone


People also ask

How do I run Android studio in offline mode?

You can enable from File->Build, Execution, Deployment->Build Tools-> Gradle-> Offline Work.

How do I turn off gradle offline mode?

(Build Tools -> Gradle)Then (uncheck -> Offline work) on the right. Click the OK button.

How do I run gradle in offline mode?

If we need to use the offline mode, just go to the Gradle window and click the Toggle Offline Mode button: After we click the button to enable offline mode, we can reload all dependencies and find that offline mode works.


2 Answers

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.

like image 172
Moussa Lhoussaine Avatar answered Sep 21 '22 17:09

Moussa Lhoussaine


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.

like image 38
Akhil Soman Avatar answered Sep 25 '22 17:09

Akhil Soman