扑扑哨兵功能'runZonedGuarded'未定义

问题描述

我正在尝试在flutter项目中添加哨兵。 从文档中,我看到我必须这样做

runZonedGuarded(
 () => runApp(MyApp(flutterI18nDelegate)),(error,stackTrace) {
try {
  sentry.captureException(
    exception: error,stackTrace: stackTrace,);
  print('Error sent to sentry.io: $error');
} catch (e) {
  print('Sending report to sentry.io failed: $e');
  print('Original error: $error');
}
});

但是我收到此错误

The function 'runZonedGuarded' isn't defined. Try importing the library that defines 'runZonedGuarded',correcting the name to the name of an existing function,or defining a function named

enter image description here

谢谢。

我的飞镖和飞镖版本

Flutter 1.20.2 • channel beta • https://github.com/flutter/flutter.git
Framework • revision bbfbf1770c (8 weeks ago) • 2020-08-13 08:33:09 -0700
Engine • revision 9d5b21729f

工具•Dart 2.9.1

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)