如果没有 google 播放服务,应用程序将无法 运行,您的设备不支持这些服务 使用 firebase 分析反应本机移动应用程序时出错

App won't run without google play services, which are not supported by your device Error while using firebase analytics for react native mobile app

我正在尝试在 React Native 应用程序上集成 firebase 分析,我已经完成了所有先决条件并在霍尼韦尔 android 设备上成功构建 运行,但是当我打开应用程序时它显示以上错误。有很多这样的重复问题,但对我来说没有任何用处,因为我无法使用 Play 商店,因为目标设备是手持 android 设备而不是移动设备。如何在不安装 google 播放服务的情况下集成 firebase 分析。

作为:

Firebase as a platform requires Google Play Services, even though some Firebase products may be able to work without it.

如果您无法使用 Google Play 服务,您可能需要 look into Google Analytics,这不需要它:

Note: Google Analytics can be used and will work on devices that do not have Google Play Services. In this case you still download and use the Google Play Services SDK and Google Analytics will automatically fall back to local dispatching.

感谢@JakeSteam 的回答 但是我可以在没有 google 播放服务错误的情况下使 firebase 集成工作。

问题详情: 我使用的是 react native firebase 5.x.x,它工作正常,但如果您的设备没有 google 播放服务,则会弹出一条有问题的消息。

解决方法: 将 react native firebase 升级到 6.x.x 版本,社区已经重新开发了这个 repo,我现在没有遇到任何问题。

注意: 如果您的设备上没有 google 播放服务,您只能使用很少的 firebase 服务,例如分析、crashlytics 等。