react-native-firebase crashlytics未显示在Firebase仪表板上 [英] react-native-firebase crashlytics not showing up on firebase dashboard

查看:171
本文介绍了react-native-firebase crashlytics未显示在Firebase仪表板上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Firebase crashlytics。我正在通过做

I am using firebase crashlytics. I am causing a crash by doing

firebase.crashlytics().crash()

,而我在Firebase仪表板上看不到崩溃报告。崩溃之所以起作用,是因为在android上我得到此屏幕

and I am not seeing the crash report on the firebase dashboard. The crash is working because on android i get this screen

,在ios上,应用程序冻结,我得到在xcode上显示到此页面

and on ios the app freezes and i get brought to this page on xcode

但是在Firebase上的crashlytics仪表板未显示崩溃。

But on the crashlytics dashboard on firebase the crashes are not showing up.

是否有任何原因导致崩溃没有显示在crashlytics仪表板上?我正在使用react-native-firebase。我知道我已正确安装它,因为我尝试使用Java在Android上自然导致崩溃,并且能够看到crashlytics崩溃。

Is there any reason why the crashes are not showing up on crashlytics dashboard? I am using react-native-firebase. I know i installed it correctly because I tried causing the crashes natively on android with java and I am able to see the crash on crashlytics.

推荐答案

TL; DR:运行 react-native run-android --variant = release ,Crashlytics才能开始正常工作,前提是您已正确设置所有设置(肯定是因为 firebase.crashlytics()。crash()使您的应用程序崩溃了。)

TL;DR: run react-native run-android --variant=release for Crashlytics to begin working properly, assuming you've set everything up correctly (which it certainly appears you have since firebase.crashlytics().crash() is crashing your application.)

请注意-为了使 react-native run-android --variant = release 正常运行,您需要配置APK发布版本根据此处的指示进行构建: https://facebook.github。 io / react-native / docs / signed-apk-android

Please note - in order for react-native run-android --variant=release to function properly, you will have needed to configure your APK for release builds according to the directions here: https://facebook.github.io/react-native/docs/signed-apk-android

自THI撰写之日起,正确报告的证明文字的证据答案。我从来没有更高兴看到我的无崩溃用户评分下降了:)

PROOF OF CRASHLYTICS PROPERLY REPORTING AS OF THE WRITING OF THIS ANSWER. I've never been happier to see my crash free users rating decrease :)

让我知道您是否有任何疑问!设置签名可能会有些混乱,所以请让我知道是否有任何疑问。

Let me know if you have any questions! Setting up signing can be a little confusing, so let me know if you have any questions.

这非常令人沮丧问题,但幸运的是,我找到了解决方案,而且我和您完全一样。

This is a very frustrating issue, but fortunately, I've found the solution and I'm in exactly the same boat you are.

看到那个大红色屏幕了吗?这是React Native在开发过程中告诉您的一些错误。立刻看不出来的是,这个红色屏幕阻止了错误进入我们的错误报告工具。在发布模式下运行您的应用程序将阻止React Native显示该红色屏幕,并且您的错误报告工具将能够报告崩溃。

See that big red screen? That's React Native's way of telling you, during development, that you've made some kind of mistake. What isn't immediately obvious is that this red screen prevents errors from making it through to our error reporting tools. Running your app in release mode will prevent React Native from showing that red screen, and your error reporting tools will be able to report crashes.

吉安(Gian)指出了在这个问题的另一个答案中,似乎是 firebase.crashlytics()。crash()无法正常运行。但是,事实并非如此。每当您在调试模式下操作时(无论何时您都可以看到红屏,您都处于我所说的调试模式),Crashlytics和其他崩溃报告工具无法捕获本机异常,但可以捕获Javascript异常。
如上所述,一旦您以发布模式运行应用程序,Crashlyitcs将能够捕获本机异常。如果您查看Crashlytics.crash(),实际上是故意用Java编写的崩溃。为了使Crashlytics实际上听到该应用程序由于本机异常而崩溃的信息,您必须在发布模式下运行,而不是在调试模式下运行。
很抱歉在这里殴打这匹死马,但我整个上午一直在研究这个问题,觉得与其他遭受与我同样命运的人分享此信息很有意义。

As Gian has pointed out in another answer to this question, it appears that firebase.crashlytics().crash() is not functioning properly. However, this isn't quite true. Whenever you are operating in debug mode (anytime you can see the red screen, you're in what I'm calling debug mode), Crashlytics and other crash reporting tools cannot catch Native Exceptions, but they can catch Javascript exceptions. Once you run the application in release mode as I’ve described above, Crashlyitcs will be able to catch Native Exceptions. If you look into Crashlytics.crash(), it’s actually an crash intentionally written in Java. In order for Crashlytics to actually ‘hear’ that the application is crashed due to a Native Exception, you have to be running in release mode, not debug mode. Sorry for beating the dead horse down here, but I’ve been looking into this issue all morning and felt it pertinent to share this information to others suffering the same fate as I was.

这篇关于react-native-firebase crashlytics未显示在Firebase仪表板上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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