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

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

error image

  • programmatically execute Touch event in android
  • Check whether the SD card is available or not programmatically
  • FastScroller only scrolls back to the first element, not to the header view
  • Emulator's Location simulation not working
  • Android Studio update -Error:Could not run build action using Gradle distribution
  • Constantly-on speech recognition listening for just one keyword
  • 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

  • Android application architecture - what is the suggested model?
  • COCOS 2D screen shot is black in Android
  • Android Application closing when debugging code block finishes
  • import cannot be resolved: import com.google.android.maps.*;
  • How to send data through PendingIntent to Broadcast?
  • Android XML rounded clipped corners
  • 4 Solutions collect form web for “Plugin with id 'com.google.gms.google-services' not found”

    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

    You can find the correct dependencies here apply changes to app.gradle and project.gradle and tell me about this, greetings!


    Your apply plugin: ‘com.google.gms.google-services’ in app.gradle looks like this:

    apply plugin: 'com.android.application'
    
    android {
        compileSdkVersion 24
        buildToolsVersion "24.0.2"
    
        defaultConfig {
            applicationId "com.example.personal.numbermania"
            minSdkVersion 10
            targetSdkVersion 24
            versionCode 1
            versionName "1.0"
    
            multiDexEnabled true
        }
    
        dexOptions {
            incremental true
            javaMaxHeapSize "4g" //Here stablished how many cores you want to use your android studi 4g = 4 cores
        }
    
        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.1'
            compile 'com.google.firebase:firebase-core:9.6.1'
            compile 'com.google.android.gms:play-services:9.6.1'
    }
    
    apply plugin: 'com.google.gms.google-services'
    

    Add classpath to the project’s gradle:

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

    Google play services library on SDK Manager:

    enter image description here

    apply plugin: 'com.google.gms.google-services'
    

    add above line at the bottom of your app gradle.build.

    In build.gradle(Module:app) add this code

    dependencies {
        ……..
        compile 'com.google.android.gms:play-services:10.0.1’
        ……  
    }
    

    If you still have a problem after that, then add this code in build.gradle(Module:app)

    defaultConfig {
        ….
        …...
        multiDexEnabled true
    }
    
    
    dependencies {
        …..
        compile 'com.google.android.gms:play-services:10.0.1'
        compile 'com.android.support:multidex:1.0.1'
    }
    
    Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.