简体   繁体   English

无法使用发布 apk 中的 Firebase 身份验证登录(无 Google Play)

[英]Cannot sigin in using Firebase Auth from release apk (no Google Play)

I am trying to login in Android app using Firebase Auth (phone).我正在尝试使用 Firebase Auth(电话)登录 Android 应用程序。

It works perfectly when in debug apk .它在调试 apk 中完美运行

But it does not work if the apk is signed (using the signature.jks file).但如果apk 已签名(使用 signature.jks 文件),则它不起作用 and says : "Unknown error" in phone after input of phone number.并说:输入电话号码后手机中"Unknown error"

I looked through different question in Stack Overflow too but they suggest to add SHA key to playstore console.我也在 Stack Overflow 中查看了不同的问题,但他们建议将SHA 密钥添加到 Playstore 控制台。 But that does not make sense.但这没有意义。 What if I want to publish the apks in amazon market or other android app market?如果我想在亚马逊市场或其他安卓应用市场发布 apk 怎么办? Firebase forbids that? Firebase 禁止这样做?

Is there any solution to it?有什么解决办法吗? I must be missing a tiny point but I am lost to find it.我一定遗漏了一个小点,但我找不到它。

You don't need to add SHA-1 fingerprint of your release key to Google Play Console.您无需将发布密钥的 SHA-1 指纹添加到 Google Play 管理中心。 But, to enable Firebase Authentication, you need to add it in Firebase Console.但是,要启用 Firebase 身份验证,您需要在 Firebase 控制台中添加它。 Follow the steps given here .按照此处给出的步骤操作。

I am coming right now from solving this issue.我现在正在解决这个问题。

Each playstores impose their own SHA1 and SHA256 key.每个 Playstore 都使用自己的 SHA1 和 SHA256 密钥。 So grab that and go to your firebase console and add it there.因此,抓住它并转到您的 firebase 控制台并将其添加到那里。

Voila it will work!!瞧,它会起作用!!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM