Error: Could not find com.google.gms:google-services:1.0. when adding google service plugin in build.gradle in android studio
I ran into the same issue today. In the samples they use this line instead:
classpath 'com.google.gms:google-services:1.3.0-beta1'
This works.
For me I had to switch the repository to jcenter()
. I was using mavenCentral and getting this error. As soon as I switched to jcenter()
it pulled the dependency down.
To do this, open your build.gradle
and replace each instance of mavenCentral()
with jcenter()
Google updated their guide. Where it was classpath 'com.google.gms:google-services:1.0' now reads classpath 'com.google.gms:google-services:1.3.0-beta1' like joluet suggested.
Google now released the plugin v1.3.0
I was able to solve it using this:
classpath 'com.google.gms:google-services:1.3.0'
I resolved this issue by doing the following things:
-
In build.gradle (at project level):
// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { mavenCentral() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:1.3.0' classpath 'com.google.gms:google-services:1.5.0-beta2' } } allprojects { repositories { mavenCentral() } }
-
In build.gradle (at module level):
On top added:
apply plugin: 'com.google.gms.google-services'
and in dependecies added:
compile 'com.google.android.gms:play-services-analytics:8.3.0'
Apart from this make sure you have updated the Google Play services and Google repository in the SDK.