1

I am trying to use Firebase, and am using Android Studio version 1.5.1 but if I try to sync my project after adding classpath 'com.google.gms:google-services:3.0.0' and the plugin at the bottom apply plugin: 'com.google.gms.google-services' of the App-level build.gradle .

The error still remains the same No cached version fof "com.google.gms:google-services:3.0.0" available for offline mode

I have tried to read existing answers on Stack Overflow, but it doesn't work for me.

AL.
  • 36,815
  • 10
  • 142
  • 281
  • You probably need to [disable offline mode](http://stackoverflow.com/q/28712025/4815718) so that Android Studio can download the needed files. – Bob Snyder Sep 15 '16 at 16:04
  • It has worked but now it brings another error `Error:Failed to resolve: com.google.firebase:firebase-core:9.0.0` @qbix –  Sep 15 '16 at 16:09
  • You probably need to open the SDK manager and download some repositories. See here: http://stackoverflow.com/a/37310513/4815718 – Bob Snyder Sep 15 '16 at 16:13
  • Thanks @qbix , it has worked :) –  Sep 15 '16 at 18:20

1 Answers1

0

I am also facing this issue. After spend 2-3 hours i find the solution. (which works for me)

Step 1:

Disable offline mode

Step 2:

Go to gradle-wrapper-properties

Replace this line

distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip

with

distributionUrl=http\://services.gradle.org/distributions/gradle-4.6-all.zip

Remove secure connection.

Yogesh Rathi
  • 6,331
  • 4
  • 51
  • 81