[英]How to crash a react native android app
I am working on react-native-firebase crashlytics.我正在研究 react-native-firebase crashlytics。 I am using rnfirebase starter kit.
我正在使用 rnfirebase 入门套件。 There we have crashlytics integrated with the project.
我们在项目中集成了 crashlytics。 Now, I want to crash my app to check the crash report.
现在,我想让我的应用程序崩溃以检查崩溃报告。
You need to import packages react-native-fabric and another line in initial file.
您需要在初始文件中导入包 react-native-fabric 和另一行。
import Fabric from 'react-native-fabric';
var { Crashlytics } = Fabric;
Crashlytics.crash();
It is now:就是现在:
import crashlytics from '@react-native-firebase/crashlytics';
then然后
crashlytics().crash()
https://rnfirebase.io/crashlytics/usage https://rnfirebase.io/crashlytics/usage
You need to need to import the crashlytics and use crash() to do a manual crash.您需要导入 crashlytics 并使用 crash() 进行手动崩溃。
import crashlytics from 'react-native-fabric-crashlytics';
Below code is help to crash your application:下面的代码有助于使您的应用程序崩溃:
crashlytics.crash();
You can import crashlytics and use crash() to do a native crash.您可以导入 crashlytics 并使用 crash() 进行本机崩溃。
import crashlytics from 'react-native-fabric-crashlytics';
crashlytics().crash();
Or you can generate a JavaScript/Typescript exception, in Release mode generates a crash.或者你可以生成一个 JavaScript/Typescript 异常,在Release模式下会生成一个崩溃。
const test: string
test!.length
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.