Crash-free statistics monitor not working in Firebase Crashlytics in Flutter

2,574

Solution 1

Finally, I found the answer. Google Analytics was disabled in my Firebase project settings and it caused issues with crash-free widget.

Here are steps to fix it:

1) Go to project settings in your Firebase project console;
2) Move to the "Integrations" tab;
3) Click "Enable" on Google Analytics widget and go through all necessary steps;
4) Wait a while to see the result.

Guide

Solution 2

I don't know exactly, but I see some problems in your settings:

  1. There is no need to add firebase_core, firebase_analytics enough as google said: enter image description here

  2. You forgot to add classpath 'com.google.gms:google-services:4.3.0' to your build.gradle (android)

  3. Maybe your project new and it doesn't have enough information to show.

Share:
2,574
saturov
Author by

saturov

Android-developer.

Updated on December 16, 2022

Comments

  • saturov
    saturov over 1 year

    I tried to set-up Firebase Crashlytics in my Flutter application. Everything works and crashes are collected properly now except for one thing. Crash-free monitor is not working and I really can do nothing with that. I see this kind of message instead of data all the time:

    enter image description here

    1) pubspec.yaml contains following dependencies:

    firebase_crashlytics: 0.1.2+4
    firebase_core: 0.4.3+2
    firebase_messaging: 6.0.9
    firebase_analytics: 5.0.9
    

    2) runner.dart

    void run() async {
      // закрепляем ориентацию todo изменить на необходимое или убрать
      await SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
    
      _initCrashlytics();
      _initLogger();
      _runApp();
    }
    
    void _runApp() {
      runZoned<Future<void>>(
        () async {
          runApp(App());
        },
        onError: Crashlytics.instance.recordError,
      );
    }
    
    void _initCrashlytics() {
      FlutterError.onError = Crashlytics.instance.recordFlutterError;
    }
    
    void _initLogger() {
      RemoteLogger.addStrategy(CrashlyticsRemoteLogStrategy());
      Logger.addStrategy(DebugLogStrategy());
      Logger.addStrategy(RemoteLogStrategy());
    }
    

    3) build.gradle (android)

    classpath 'io.fabric.tools:gradle:1.31.2'
    

    4) build.gradle (android/app)

    apply plugin: 'io.fabric'
    apply plugin: 'com.google.gms.google-services'
    

    No errors in LogCat, no warnings, nothing. I see successful initialization message in logs every time application starts:

    2020-01-10 12:27:32.691 23082-23082/ru.app.biz.client.android.debug I/FirebaseInitProvider: FirebaseApp initialization successful
    

    I even tried to add Google Analytics dependency directly into my Android module but with no luck. Both Android and iOS applications are under this issue.

    What am I doing wrong?

  • mikeyman22
    mikeyman22 about 4 years
    When did you get this message image from? The Firebase documentation for setting up Flutter still says firebase-core is required: firebase.google.com/docs/flutter/setup?platform=android
  • Amir Aharon
    Amir Aharon almost 4 years
    Same problem happens to me. can you describe some of the "necessary steps" in (3)