google-services plugin could not detect any version for com.google.android.gms or com.google.firebase, default version: 9.0.0 will be used

Lokesh Tiwari picture Lokesh Tiwari · Jun 13, 2016 · Viewed 15.4k times · Source

I am integrating fire-base to my existing project used these libs

   compile 'com.google.firebase:firebase-auth:9.0.2'
compile 'com.google.firebase:firebase-database:9.0.2'
compile 'com.google.android.gms:play-services:9.0.2'

Dependencies

    dependencies {
    classpath 'com.android.tools.build:gradle:2.1.2'
    classpath 'com.google.gms:google-services:3.0.0'
    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

I am getting this error

Error:Execution failed for task ':app:processDebugGoogleServices'.

Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 9.0.0.

Not able to figure out what is happening ??

These are my play services verison enter image description here

Answer

Lokesh Tiwari picture Lokesh Tiwari · Jun 13, 2016

I have added this line at last in build.gradle:(Module: app)

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

and it started working I don't know what is concept behind this?
but it is working