且构网

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

Firebase身份验证-初始化多个项目(FirebaseUiException:代码10)

更新时间:2023-12-05 22:15:10

解决方案

问题1

每个程序包只能与一个SHA-1键关联. 当删除其他Firebase项目并使用SHA-1键将 shared Firebase项目恢复为原始状态时,控制台会显示以下错误,表明存在问题.

Solutions

Issue 1

Each package may only be associated with one SHA-1 key. When removing the additional Firebase project and reverting the shared Firebase project to it's original state with the SHA-1 key the console provided the following error which revealed an issue.

此软件包名称和SHA-1的OAuth2客户端已存在项目

此错误消息最初未显示,对于第一次在具有相同Android包名称的Firebase项目中检测到相同的SHA-1键很有用.

This error message did not show originally, and would be useful to see the first time the same SHA-1 key is detected in a Firebase project with the same Android package name.

从其他具有相同程序包名称的Firebase项目中删除SHA-1键.在Android应用程序中使用两个Firebase项目时,它们不能使用相同的SHA-1键.

Remove the SHA-1 key from any other Firebase projects with the same package name. When using two Firebase projects in an Android application, they cannot use the same SHA-1 key.

不是从第二个新创建的项目中的 google-services.json 生成默认的Firebase项目.

The default Firebase project was not being generated from the google-services.json in the second newly created project.

在Android Studio中的 Build > Rebuild Project

Rebuild the project in Android Studio under Build > Rebuild Project