Plugin with id 'com.google.gms.google-services' not found

Lakshmi picture Lakshmi · Oct 6, 2016 · Viewed 152.1k times · Source

I have followed this link to integrate ads in my app. But it shows this error:

error image

This is my build.gradle:

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 24
buildToolsVersion "24.0.2"





defaultConfig {
    applicationId "com.example.personal.numbermania"
    minSdkVersion 10
    targetSdkVersion 24
    versionCode 1
    versionName "1.0"
}
buildTypes {
    debug
            {
                debuggable true
            }
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}


dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:24.2.1'
    compile 'com.android.support:design:24.2.1'
    compile 'com.google.firebase:firebase-ads:9.6.0'

}

}

ads are not showing up in real device.please help me This is my error after i updated classpath error

Answer

Vasily Kabunov picture Vasily Kabunov · Feb 11, 2017

Had the same problem.

Fixed by adding the dependency

classpath 'com.google.gms:google-services:3.0.0'

to the root build.gradle.

https://firebase.google.com/docs/android/setup#manually_add_firebase