Facebook 和 Google 登录不适用于上传到 Firebase App Distribution 的 Android AAB 构建

Facebook and Google login doesn't work for Android AAB build uploaded to Firebase App Distribution

已解决Firebase troubleshooting页面已更新:

When you upload an AAB to App Distribution, Google Play automatically resigns the generated APK using a test app signing key certificate. When prompted, you must register your app with API providers if you want to continue using their third-party services. Once signed, your app's test certificate can be viewed in the Firebase console.


自从我开始在 Firebase App Distribution 上上传 AAB 而不是 APK,我注意到 Facebok 和 Google 身份验证不再有效。

在我的 Firebase Android 应用程序设置中,我已经添加了以下 SHA-1 指纹:

我还在 Meta (Facebook) 开发者控制台中上传了他们相关的 base64 哈希键。

一切都按预期进行,直到我开始上传 AAB 而不是 APK。例如,当我尝试使用 Facebook 登录时,会显示以下错误消息:

Invalid key hash. They key hash <key_hash> does not match any stored key hashes. Configure your app key hashes at https://developers.facebook.com/app/<facebook_app_id>/

从这个密钥散列中,我已经能够检索到其关联的 SHA-1 指纹。将其添加到 Firebase 的 Android 应用程序设置(并更新 google-services.json 文件)并在 Facebook 控制台中添加密钥哈希后,社交身份验证就可以工作了。

但问题是:我最初应该在哪里找到这个 SHA-1 指纹?它不适用于 ./gradlew signingReport 输出或 Google Play 控制台。我也找不到任何文档。

预先感谢您的帮助。

Firebase 应用分发 re-signs 上传时的 AAB。

"After you upload an AAB for the first time, App Distribution generates a new test certificate. All AAB uploads are re-signed with this test certificate. Use the certificate fingerprints below to register your app signing key with API providers..."

以下是 Firebase 控制台的屏幕截图,您可以在其中找到此信息:

在您的 Firebase 项目设置中添加这些 SHA-1 和 SHA-256 指纹后,您就可以开始了。