I am getting this error while adding "com.google.gms:google-services:3.0.0"
this script in my build.gradle
dependency.
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'
-
I tried to add this dependency to connect to google analytics and added this to build.gradle(module) but showing the same error May 17, 2022 at 21:23
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.