0

Is there any way we can force crash react native production apk ?

I know there is one option with Crashlytics.crash(); in fabric but i don't want to use Crashlytics as i am already using bugsnag.

Shubhanu Sharma
  • 1,957
  • 12
  • 30
  • 1
    Check out the Bugsnag React Native example app for some examples of how to trigger crashes for testing: https://github.com/bugsnag/bugsnag-react-native/tree/master/examples/plain E.g. to trigger a native crash: https://github.com/bugsnag/bugsnag-react-native/blob/84f9cd639c2e38231616d15a85eba153da14a70e/examples/plain/app/index.js#L16 which uses: https://github.com/bugsnag/bugsnag-react-native/blob/master/examples/plain/app/lib/native_crash.js – Bugsnag Support May 17 '19 at 12:40

1 Answers1

0

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

import Fabric from 'react-native-fabric';
var { Crashlytics } = Fabric;
Crashlytics.crash();
Dishant Chanchad
  • 710
  • 3
  • 9
  • 27