Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[馃摎] Crashlytics recordFlutterFatalError #8815

Closed
ftognetto opened this issue Jun 1, 2022 · 3 comments 路 Fixed by #9669
Closed

[馃摎] Crashlytics recordFlutterFatalError #8815

ftognetto opened this issue Jun 1, 2022 · 3 comments 路 Fixed by #9669
Labels
good first issue Good for newcomers plugin: crashlytics type: documentation Improvements or additions to documentation

Comments

@ftognetto
Copy link

Hello, on the new documentation of crashlytics https://firebase.google.com/docs/crashlytics/get-started it is written to use

FlutterError.onError = FirebaseCrashlytics.instance.**recordFlutterFatalError**;

instead on https://pub.dev/packages/firebase_crashlytics it is written to use

FlutterError.onError = FirebaseCrashlytics.instance.**recordFlutterError**;

I always used the second one but on the new documentation it use recordFlutterFatalError and this is causing me a lot of trouble on the crashlytics dashboard because every error is marked as a crash.

Why then? Thank you

@ftognetto ftognetto added good first issue Good for newcomers type: documentation Improvements or additions to documentation labels Jun 1, 2022
@darshankawar darshankawar added triage Issue is currently being triaged. plugin: crashlytics and removed triage Issue is currently being triaged. labels Jun 1, 2022
@oodavid
Copy link

oodavid commented Jun 15, 2022

I came here to ask this very question.

We recently upgraded our various FlutterFire plugins, changed our implementation to match the new documentation and now everything is being logged as fatal.

My main.dart looks like this:

void main() async {
  await runZonedGuarded(() async {
    // Initialise Firebase before rendering the app, see: https://firebase.flutter.dev/docs/overview/#initializing-flutterfire
    WidgetsFlutterBinding.ensureInitialized();
    await Firebase.initializeApp();
    // Error logging
    FlutterError.onError = FirebaseCrashlytics.instance.recordFlutterFatalError;
    Isolate.current.addErrorListener(RawReceivePort((pair) async {
      final List<dynamic> errorAndStacktrace = pair;
      await FirebaseCrashlytics.instance.recordError(
        errorAndStacktrace.first,
        errorAndStacktrace.last,
      );
    }).sendPort);
    // Get cracking
    runApp(MyApp());
  }, (error, stack) {
    FirebaseCrashlytics.instance.recordError(error, stack, fatal: true);
  });
}

Possibly related: #8779

@maximveksler
Copy link

maximveksler commented Aug 9, 2022

My main.dart looks like this:

@oodavid is

    Isolate.current.addErrorListener(RawReceivePort((pair) async {
      final List<dynamic> errorAndStacktrace = pair;
      await FirebaseCrashlytics.instance.recordError(
        errorAndStacktrace.first,
        errorAndStacktrace.last,
      );
    }).sendPort);

Actually working for you?

I'm getting compilation errors -

image

@niklaesAtMonta
Copy link

niklaesAtMonta commented Aug 11, 2022

Having the same issue,
I might switch back to recordFlutterError since I do not want the errors marked as crashes

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Good for newcomers plugin: crashlytics type: documentation Improvements or additions to documentation
Projects
None yet
5 participants