How to crash a react native android app
Asked Answered
E

4

6

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.

Epigraphy answered 1/6, 2018 at 10:7 Comment(0)
K
8

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();
Karyokinesis answered 1/6, 2018 at 10:42 Comment(0)
C
8

It is now:

import crashlytics from '@react-native-firebase/crashlytics';

then

crashlytics().crash()

https://rnfirebase.io/crashlytics/usage

Crissycrist answered 6/5, 2020 at 20:59 Comment(0)
D
4

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

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

Calling the code below should crash your application:

crashlytics().crash();
Deductive answered 1/6, 2018 at 10:41 Comment(0)
R
0

You can import crashlytics and use crash() to do a native crash.

import crashlytics from 'react-native-fabric-crashlytics';
crashlytics().crash();
Rhonarhonchus answered 24/8, 2022 at 13:25 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.