简体   繁体   English

如何使反应原生 android 应用程序崩溃

[英]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.

相关问题 如何获取在启动时立即崩溃的 React Native Android 应用程序的崩溃日志 - How to get crash logs for a React Native Android app that crashes immediately on launch React Native 崩溃 - 灰色屏幕 - 仅限 App Center 构建 - com.facebook.react.bridge.CatalystInstanceImpl.jniLoadScriptFromAssets(本地方法) - React Native Crash - Grey Screen - App Center build only - com.facebook.react.bridge.CatalystInstanceImpl.jniLoadScriptFromAssets(Native Method) 通过添加此行来应对本机应用程序崩溃:apply plugin: 'com.google.gms.google-services' - react native app crash by adding this line: apply plugin: 'com.google.gms.google-services' 反应本机 crashlytics crashlytics().crash() 不崩溃 - react native crashlytics crashlytics().crash() not crashing 在 Google App Engine 上反应应用程序崩溃循环 - React app crash loop on Google App Engine 如何让 Android 和 iOS 的 Flutter App 崩溃(测试 Firebase Crashlytics)? - How to crash Flutter App for Android and iOS (to test Firebase Crashlytics)? 如何在我的 React 本机应用程序中覆盖 AmplifyTheme - How can I override the AmplifyTheme in my react native app signInWithRedirect 在 React Native 应用程序中可用 - signInWithRedirect is available in React Native app Kotlin 协程在 Android 应用程序中未完成时崩溃 - Crash when Kotlin Coroutine Not Complete in Android App 如何在 React Native 应用程序上显示 firebase 存储中的所有图像? - How to display all images from firebase storage on React Native app?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM