问题
Im getting this error out of nowhere it used to work just fine. Here is what i have:
in app.gradle dependencies:
implementation "com.google.firebase:firebase-core:16.0.1"
implementation "com.google.firebase:firebase-messaging:17.3.1"
in app.gradle end of file:
apply plugin: 'com.google.gms.google-services'
in project gradle file:
dependencies {
classpath 'com.android.tools.build:gradle:3.3.0-alpha10'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'io.fabric.tools:gradle:1.+'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:4.1.0'
}
And the google-services.json is located in about every folder of my project just to see if it is working.
but still getting the above error.
回答1:
I got the same error, not sure what's the root cause, but as a workaround found a solution.
Downgrade classpath 'com.google.gms:google-services:4.1.0'
to classpath 'com.google.gms:google-services:4.0.0'
and it should work, at least it did for me.
回答2:
After updating to Android Studio 3.3 I started getting the same error. It turns out version 4.1.0
of com.google.gms:google-services
had a known issue in Android Studio 3.3.
Updating to com.google.gms:google-services:4.2.0
solved the problem for me.
来源:https://stackoverflow.com/questions/52374463/googleservice-failed-to-initialize-status-10-missing-google-app-id-value-from