问题
Online it says to downgrade the dependencies for Firebase Auth but I have done that and it does not work.
回答1:
You should ensure that all your firebase dependencies are using the same version. I was also facing the same issue, using stable version 15.0.0
worked well for my case.
回答2:
Check that your google-services is updated, in build.gradle.project
classpath 'com.google.gms:google-services:4.0.1'
and try changing your Auth to:
implementation 'com.google.firebase:firebase-auth:16.0.1'
adding the following implementation:
implementation 'com.android.support:support-v4:28.0.0'
回答3:
replace it
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'com.google.firebase:firebase-auth:18.0.0'
implementation 'com.google.firebase:firebase-core:17.0.0'
<!-- add in Gradel.properties-->
android.useAndroidX=true
android.enableJetifier=true
<!-- for Activity -->
make sure your activity AppCompatActivity use below imports
import androidx.appcompat.app.AppCompatActivity;
<!-- add in build.gradel-->
classpath 'com.google.gms:google-services:4.3.0'
回答4:
in build your build.gradle(Module:app) add this line
apply plugin: 'com.google.gms.google-services'
and in you build.gradle(project:)file copy paste this
dependencies {
classpath 'com.android.tools.build:gradle:3.3.2'
classpath 'com.google.gms:google-services:4.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
and you also have to take care that all your firebase dependencies should be of same version.
回答5:
Go to your developer console and unrestrict all the firebase APIs. It might have happened because of upgrades to your plan.
回答6:
the thing is this is not an issue you just need to check your SHA-1 key is updated in your firebase project just update that and check you will not get this problem.
回答7:
Use an emulator with Google Play installed.
来源:https://stackoverflow.com/questions/55095074/firebaseauth-getgoogleapiformethod-returned-gms-com-google-firebase-auth-api