简体   繁体   English

带有 Flutter 的 Firebase Crashlytics NDK

[英]Firebase Crashlytics NDK With Flutter

I have a C++ backend and I would like to get reports of NDK crashes.我有一个 C++ 后端,我想收到 NDK 崩溃的报告。 My problem is crashlytics with NDK seems to be only available for native Android, not flutter.我的问题是 NDK 的 crashlytics 似乎只适用于原生 Android,而不是颤振。 You can see it here.你可以在这里看到它。 I have crashlytics setup in Flutter with FireFlutter and I tried to catch NDK errors with the following in flutter but it of course does not work:我在 Flutter 中使用 FireFlutter 设置了 crashlytics 并且我尝试在 Flutter 中使用以下内容捕获 NDK 错误,但它当然不起作用:

// Pass all uncaught errors from the framework to Crashlytics.
    FlutterError.onError = FirebaseCrashlytics.instance.recordFlutterError;

    // To catch errors that happen outside of the Flutter context, install an error listener on the current Isolate:
    Isolate.current.addErrorListener(RawReceivePort((pair) async {
      final List<dynamic> errorAndStacktrace = pair;
      await FirebaseCrashlytics.instance.recordError(
        errorAndStacktrace.first,
        errorAndStacktrace.last,
      );
    }).sendPort);

I searched this for so long but I could not find any resources to get crashlytics NDK to work with Flutter.我搜索了这么久,但我找不到任何资源来让 crashlytics NDK 与 Flutter 一起工作。 I am also using other firebase services in flutter such as Remote Config, Analytics, Performance etc. How may I use crashlytics with NDK in Flutter?我还在 Flutter 中使用其他 firebase 服务,例如远程配置、分析、性能等。 如何在 Flutter 中将 crashlytics 与 NDK 一起使用? Is this possible at all?这可能吗?

Broadly speaking, anything that is available for Android is already available for Flutter.从广义上讲,任何适用于 Android 的东西都已经适用于 Flutter。 That is how many phugins work on flutter, they're implemented in native and bridged to flutter.这就是有多少 phugins 在 flutter 上工作,它们在原生中实现并桥接到 flutter。 Similarly, for adding NDK crashalytics, you can treat the /android folder of your flutter project as a native android project and proceed with all the steps that are mentioned in this link to add NDK crashalytics to a native android app.同样,要添加 NDK crashalytics,您可以将 flutter 项目的/android文件夹视为原生 android 项目,并继续执行此链接中提到的所有步骤,将 NDK crashalytics 添加到原生 android 应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM