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
Add classpath com.google.gms:google-services:3.0.0
dependencies at project level build.gradle
Refer the sample block from project level build.gradle
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
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
}
}
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:
Had the same problem.
adding this to my dependency didn't solve
classpath 'com.google.gms:google-services:3.0.0'
Adding this solved for me
classpath 'com.google.gms:google-services:+'
to the root build.gradle.
simply add "classpath 'com.google.gms:google-services:3.0.0'" to android/build.gradle to look like this
buildscript {
repositories {
maven {
url "https://maven.google.com"
}
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
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
}
}
and also add "apply plugin: 'com.google.gms.google-services'" to the end of file in android/app/build.gradle to look like this
apply plugin: 'com.google.gms.google-services'
Go To Setting > Android SDK > SDK Tools > Google Play Services
On upgrading to Android Studio 4.2.1, I was prompted to set dependency:
classpath 'com.google.gms:google-services:4.3.7'
However, this caused "Plugin with id 'com.google.gms.google-services' not found".
Leaving it as follows fixed the problem:
classpath 'com.google.gms:google-services:4.3.5'
EDIT:
This problem has now been fixed in:
classpath 'com.google.gms:google-services:4.3.8'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With