Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not find method classpath() for arguments [com.google.gms:google-services:3.0.0]

I am getting this error while adding "com.google.gms:google-services:3.0.0" this script in my build.gradle dependency.

like image 731
Gobind kumar Avatar asked Oct 25 '16 05:10

Gobind kumar


2 Answers

Apply this in build.gradle(Project: your project name) where tools.build:gradle is present and not in build.gradle(Module: app)

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.1.2'

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

In build.gradle(Module: app) outside dependencies add this:

apply plugin: 'com.google.gms.google-services'
like image 140
Myth Avatar answered Oct 03 '22 05:10

Myth


If you are facing problem of connecting firebase to android studio then goto Tools -> Firebase -> Select any option like authenticate using google-sign in -> then click add the firebase authenticate -> Dependencies will be added automatically. This helped me.

like image 1
UNREAL Avatar answered Oct 01 '22 05:10

UNREAL