I have this in my top-level build.gradle:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath \'com.google.gms:google-s
That's because you should always put the "apply plugin" clause at the bottom for google-services, since it looks for the already-added dependencies. Do it like this in your app-level gradle:
dependencies {
compile 'com.google.android.gms:play-services-ads:9.0.1'
}
// ADD THIS AT THE BOTTOM
apply plugin: 'com.google.gms.google-services'
This is hidden in the Firebase documentation, but applies even if you don't use Firebase.
Note : Update Google Repository also.
Update com.google.firebase:firebase-messaging:9.0.2
and com.google.android.gms:play-services:9.0.2
to same version(latest version) and sync the project.
Check if plugin is added on bottom like this.
dependencies {
compile 'com.android.support:appcompat-v7:24.0.0'
..................
}
apply plugin: 'com.google.gms.google-services'
Check the version of google services that you have in your root level build.gradle. This should be 3.0.0 or higher:
buildscript {
ext.kotlin_version = '1.0.2'
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
classpath 'com.google.gms:google-services:3.0.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}