I am integrating OAuth login for Google+ on my android application, following the tutorial.
According to the tutorial, I should add the Google Service plugin by addi
Google has updated GCM go check it and for that you have to update your Android Studio too.
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()
If you use Android Studio, try to add google service with the IDE.
Developer Services
choose desired service.add classpath
on buildscript
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.google.gms:google-services:1.3.0-beta1'
}
}
You should just add classpath 'com.google.gms:google-services:1.3.0-beta1
' to dependencies
of your (Top level build file)
the build.gradle
that has the (Project:<name of your project)
. Hope this helps!
I recently updated to Android Studio 2.3 and somehow apply plugin doesn't work.
After that, I tried various ways and then what work is when I commented out app's build.gradle:
apply plugin: 'com.google.gms.google-services'
and then I add this to top-level build.gradle (below classpath 'com.android.tools.build:gradle:2.2.3'):
classpath 'com.google.gms:google-services:3.0.0'
and then it works.
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.