Android的Firebase突然不工作在我的测试设备 [英] Firebase for android not working in my test device suddenly

查看:382
本文介绍了Android的Firebase突然不工作在我的测试设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Firebase身份验证和实时数据库构建应用程序。在昨天之前,它在测试中在我的设备上工作很酷。但是我现在无法登录到Firebase,但是这个应用程序正在使用我朋友的其他设备。



这里的实际问题是什么?测试应用程序是否有任何限制你自己的真实设备?是否超过某种限制?



我试着卸载应用程序并重新安装,从firebase数据库中删除用户帐户。但仍然没有工作。



谢谢!

解决方案

我遇到了同样的问题, Google登录可以在模拟器或连接的测试设备上正常工作,但不会在从Google Play商店下载您的Firebase应用的实际设备上正常工作。这是因为你的android studio生成的apk文件是由默认调试证书指纹签名的,因为你在google play store上发布的应用程序是由不同的证书指纹签名的。



这两个证书的指纹应该在firebase控制台列入白名单,否则谷歌登录将不会验证用户。

所以要解决这个问题,遵循两个步骤。


  1. 使用以下命令在MAC上生成发行证书指纹
    $ b MAC:
    keytool -exportcert -list -v \
    -alias your-key-name - keystore path-to-production-keystore


得到如下输出:

keytool -exportcert -list -v \
-alias aliasName -keystore /pathToKeystore/keyStore.jks
输入keystore密码:
创建日期:2017年5月27日
输入类型:PrivateKeyEntry
证书链长度:1
证书指纹:
MD5:11:D0:F1:F6:26:F3:44:77:88
SHA1:D6:44:55:66:77 :88:99:55:HH:AC:DB:17:8A

其中SHA1:是您的指纹密钥,请将其复制。

有关如何在MAC / WINDOWS上生成指纹的更多信息,请访问 https://developers.google.com/android/guides/client-auth


  1. 粘贴上方SHA1键到您的Firebase项目设置并保存。 Google登录现在应该可以正常工作了。
  2. android.com/studio/publish/app-signing.htmlrel =nofollow noreferrer> https://developer.android.com/studio/publish/app-signing.html


    I am building an app with Firebase Authentication and Realtime Database. Before yesterday, it was working cool in my device while testing. But I am not able to even login with Firebase now, but the app is working on other devices of my friends.

    What is the actual issue here ? Is there any limitation for testing app your own real device? Is some kind of limitation exceeded ?

    I tried uninstalling the app and reinstalling, removing user account from firebase database. But still no work.

    Thanks!!

    解决方案

    I faced the same issue and found the solution.

    The Google Sign in works fine on emulators or on connected test devices but not on actual devices that downloads the your firebase app from google play store. This is because the apk file generated by your android studio is signed by default debug certificate fingerprint where as the application you publish on google play store is signed by different certificate finger print.

    Both the certificate finger print should be whitelisted in firebase console otherwise the google sign in will not authenticate the user.

    So to resolve this issue follow two steps.

    1. Generate the release certificate fingerprint with following command on MAC

      MAC: keytool -exportcert -list -v \ -alias your-key-name -keystore path-to-production-keystore

    you will get output like following :

    keytool -exportcert -list -v \ -alias aliasName -keystore /pathToKeystore/keyStore.jks Enter keystore password: Creation date: 27 May, 2017 Entry type: PrivateKeyEntry Certificate chain length: 1 Certificate fingerprints: MD5: 11:D0:F1:F6:26:F3:44:77:88 SHA1: D6:44:55:66:77:88:99:55:HH:AC:DB:17:8A

    Where SHA1: is your fingerprint key, copy it.

    For more info on how to generate fingerprint on MAC/WINDOWS visit https://developers.google.com/android/guides/client-auth

    1. Paste above SHA1 key to your firebase "Project Settings" and save. Google sign in should work fine now.

    To read more on how this works visit https://developer.android.com/studio/publish/app-signing.html

    这篇关于Android的Firebase突然不工作在我的测试设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆