【问题标题】:How to locate crashes in react-native project caught by firebase crashlyitics如何在 firebase crashlyitics 捕获的 react-native 项目中定位崩溃
【发布时间】:2023-02-21 08:23:43
【问题描述】:

我将项目部署到生产环境,并为该应用配置了 firebase crashlytics。发生了一些崩溃,firebase crashlytics 捕获了这些崩溃,但我如何在我的项目中找到这些崩溃

我如何在我的项目中定位上面的崩溃,有什么方法可以定位上面的错误,我需要信息,比如错误发生在哪个文件中,请帮助我定位错误

【问题讨论】:

    标签: ios firebase react-native crashlytics


    【解决方案1】:

    仅安装 crashlytics 不足以让 react-native 获得合理的错误记录。为了实现合理的错误,您还需要发送一个 js 错误堆栈跟踪,您可以使用 - https://github.com/a7ul/react-native-exception-handler

    import {setJSExceptionHandler} from 'react-native-exception-handler';
    
    setJSExceptionHandler((error, isFatal) => {
      if(isFatal)
      {
      crashlytics().recordError(new Error(error));
      }
    });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-12-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-06-01
      相关资源
      最近更新 更多