How to crash a react native android app

久未见 提交于 2019-12-11 03:13:10

问题


I am working on react-native-firebase crashlytics. I am using rnfirebase starter kit. There we have crashlytics integrated with the project. Now, I want to crash my app to check the crash report.


回答1:


You need to import packages react-native-fabric and another line in initial file.

    import Fabric from 'react-native-fabric';
    var { Crashlytics } = Fabric;
    Crashlytics.crash();



回答2:


You need to need to import the crashlytics and use crash() to do a manual crash.

import crashlytics from 'react-native-fabric-crashlytics';

Below code is help to crash your application:

crashlytics.crash();


来源:https://stackoverflow.com/questions/50641057/how-to-crash-a-react-native-android-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!