且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

适用于Google登录的Android Firebase身份验证失败

更新时间:2023-12-05 21:36:46

在我以前使用Firebase FriendlyChat的测试应用程序中,我在登录时遇到了类似的失败,但是我已经通过使用Google API控制台( https://console.developers.google.com/apis/credentials?project= )然后为您的Android客户端下载"client_secret.json"(在我的情况下,我需要重命名下载的文件名"client_secret_xxxxx.json"),将此文件放在AndroidStudio项目的"/src/main/resources"下(创建"resources" 文件夹(如果不存在)),然后尝试重新编译并运行您的Android应用.

In my previous test app using Firebase FriendlyChat, I have encountered similar failure in Sign In, but I have solved it by going Google API console (https://console.developers.google.com/apis/credentials?project=) then download "client_secret.json" (in my case, I need to rename the downloaded filename "client_secret_xxxxx.json") for your Android client, put this file in your AndroidStudio project under "/src/main/resources" (create "resources" folder if not exist) then try to compile and run your Android app again.

摘要:您需要2个json文件:Firebase控制台中的"google-services.json"和Google API控制台中的"client_secret.json".

Summary: you need 2 json files : "google-services.json" from Firebase Console and "client_secret.json" from Google API Console.

希望这可以解决您的问题.

Hope this solve your problem.