FirebaseAuth: getGoogleApiForMethod() returned Gms: com.google.firebase.auth.api.internal.zzal@9cd3393

无人久伴 提交于 2021-02-08 10:57:17

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!