Flutterfire: [firebase_crashlytics] I don't see any report in firebase console

Created on 12 Nov 2019  ยท  17Comments  ยท  Source: FirebaseExtended/flutterfire

when I call Crashlytics.instance.crash(); or div by 0... I don't see any report in console

โ•โ•โ•โ•โ•โ•โ•โ• Exception caught by gesture โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
The following StateError was thrown while handling a gesture:
Bad state: Error thrown by Crashlytics plugin

When the exception was thrown, this was the stack: 
#0      Crashlytics.crash (package:firebase_crashlytics/src/firebase_crashlytics.dart:54:5)
#1      _MyHomePageState._incrementCounter.<anonymous closure> (package:firebase_crashlytics_test/main.dart:50:30)
#2      State.setState (package:flutter/src/widgets/framework.dart:1141:30)
#3      _MyHomePageState._incrementCounter (package:firebase_crashlytics_test/main.dart:47:5)
#4      _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:654:14)
...
Handler: "onTap"
Recognizer: TapGestureRecognizer#1a99a
  debugOwner: GestureDetector
  state: ready
  won arena
  finalPosition: Offset(342.9, 710.9)
  finalLocalPosition: Offset(22.2, 23.6)
  sent tap down
โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

my repo firebase_crashlytics_test
doctor -v

[โœ“] Flutter (Channel stable, v1.9.1+hotfix.6, on Linux, locale en_US.UTF-8)
    โ€ข Flutter version 1.9.1+hotfix.6 at /home/tbm98/Documents/FLUTTER_SDK/flutter
    โ€ข Framework revision 68587a0916 (9 weeks ago), 2019-09-13 19:46:58 -0700
    โ€ข Engine revision b863200c37
    โ€ข Dart version 2.5.0


[!] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    โ€ข Android SDK at /home/tbm98/Android/Sdk
    โ€ข Android NDK location not configured (optional; useful for native profiling support)
    โ€ข Platform android-29, build-tools 29.0.2
    โ€ข Java binary at: /home/tbm98/Documents/android-studio/jre/bin/java
    โ€ข Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
    ! Some Android licenses not accepted.  To resolve this, run: flutter doctor --android-licenses

[โœ“] Android Studio (version 3.5)
    โ€ข Android Studio at /home/tbm98/Documents/android-studio
    โ€ข Flutter plugin version 41.1.2
    โ€ข Dart plugin version 191.8593
    โ€ข Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)

[โœ“] Connected device (1 available)
    โ€ข AOSP on IA Emulator โ€ข emulator-5554 โ€ข android-x86 โ€ข Android 9 (API 28) (emulator)

! Doctor found issues in 1 category.
crowd crashlytics bug

Most helpful comment

I have the same problem

All 17 comments

Have the same issue. Did you find any solution?

@olga0 it is not a bug, It will display on the console within 24 hours

I still do not see any reports in console even after 3 days.

@olga0 what did you do ?

  1. I added Fabric repository and classpath to my [project]/android/build.gradle:
buildscript {
    ext.kotlin_version = '1.3.50'
    repositories {
        google()
        jcenter()
        maven {
            url 'https://maven.fabric.io/public'
        }
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.2'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'com.google.gms:google-services:4.3.3'
        classpath 'io.fabric.tools:gradle:1.26.1'
    }
}
  1. I added plugins and crashlytics dependency to the [project]/android/app/build.gradle:
dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}

apply plugin: 'com.google.gms.google-services'
apply plugin: 'io.fabric'
  1. I added dependency
firebase_crashlytics: ^0.1.0+3

to my pubspec.yaml file and run "Packages get".

  1. Here is my main.dart file:
import 'dart:async';
import 'package:firebase_crashlytics/firebase_crashlytics.dart';
import 'package:flutter/material.dart';
import 'package:kids_development/levels/main_page.dart';

void main() {
  Crashlytics.instance.enableInDevMode = true;
  FlutterError.onError = Crashlytics.instance.recordFlutterError;

  runZoned<Future<void>>(() async {
    runApp(MyApp());
  }, onError: Crashlytics.instance.recordError);
}

class MyApp extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => _MyAppState();

}

class _MyAppState extends State<MyApp> {

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        primarySwatch: Colors.amber,
      ),
      home: MainPage(),
    );
  }
}
  1. Here is my main_page.dart file:
import 'package:firebase_crashlytics/firebase_crashlytics.dart';
import 'package:flutter/material.dart';

class MainPage extends StatefulWidget {
  final String _locale;

  MainPage(this._locale);

  @override
  State<StatefulWidget> createState() {
    return MainPageState();
  }
}

class MainPageState extends State<MainPage> {

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Kids Development'),
      ),
      body: Container(
        width: double.infinity,
        margin: EdgeInsets.all(15.0),
        child: RaisedButton(
          child: Text('Crash!'),
          onPressed: () {
            Crashlytics.instance.crash();
          },
        ),
      ),
    );
  }
}
  1. I created a project in Firebase Console and added my app there.

  2. I run my app on my Android phone and the app was connected to Firebase Console.

  3. When I click "Crash" button I got this logs:

โ•โ•โ•โ•โ•โ•โ•โ• Exception caught by gesture โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
The following StateError was thrown while handling a gesture:
Bad state: Error thrown by Crashlytics plugin

When the exception was thrown, this was the stack: 
#0      Crashlytics.crash (package:firebase_crashlytics/src/firebase_crashlytics.dart:50:5)
#1      MainPageState.build.<anonymous closure> (package:kids_development/levels/main_page.dart:150:38)
#2      _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:654:14)
#3      _InkResponseState.build.<anonymous closure> (package:flutter/src/material/ink_well.dart:729:32)
#4      GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:182:24)
...
Handler: "onTap"
Recognizer: TapGestureRecognizer#b4911
  debugOwner: GestureDetector
  state: possible
  won arena
  finalPosition: Offset(182.2, 527.5)
  finalLocalPosition: Offset(46.2, 26.5)
  sent tap down

Flutter doctor:

[โˆš] Flutter (Channel stable, v1.9.1+hotfix.6, on Microsoft Windows [Version 10.0.18362.476], locale en-US)
    โ€ข Flutter version 1.9.1+hotfix.6 at C:\Users\olgam\source\flutter
    โ€ข Framework revision 68587a0916 (10 weeks ago), 2019-09-13 19:46:58 -0700
    โ€ข Engine revision b863200c37
    โ€ข Dart version 2.5.0

[โˆš] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    โ€ข Android SDK at C:\Users\olgam\AppData\Local\Android\sdk
    โ€ข Android NDK location not configured (optional; useful for native profiling support)
    โ€ข Platform android-28, build-tools 28.0.3
    โ€ข Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    โ€ข Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
    โ€ข All Android licenses accepted.

[โˆš] Android Studio (version 3.5)
    โ€ข Android Studio at C:\Program Files\Android\Android Studio
    โ€ข Flutter plugin version 41.1.2
    โ€ข Dart plugin version 191.8593
    โ€ข Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)

[โˆš] Connected device (2 available)
    โ€ข SM G930U            โ€ข d77c5f0b      โ€ข android-arm64 โ€ข Android 8.0.0 (API 26)
    โ€ข AOSP on IA Emulator โ€ข emulator-5554 โ€ข android-x86   โ€ข Android 9 (API 28) (emulator)

โ€ข No issues found!

Also experiencing this. No fatal or non-fatal crash reports are appearing in Firebase console's crashlytics tab. The version string for the flutter app is also unsearchable in the filters on the crashlytics tab.

default console set filter like this
Screenshot-20191120121745-1189x706

after cancel all filter
Screenshot-20191120121812-1327x788

let try cancel all filter :D

I cancelled all filters. Still nothing.
Capture

probably wait for flutter team :D

I have the same problem

Is there any way to fix this?

I can't get it to work for iOS, see full description of the issue here.
StackOverflow #60111182

Someone who got it to work for iOS?

@olga0 You seem to have done everything as per the documentation. Note Crashlytics seems to have never been right. See the long standing issue https://github.com/FirebaseExtended/flutterfire/issues/1147

I'd recommend using something else like Sentry.

I am also seeing this issue. But I don't want to use sentry, because firebase has much better pricing (Free). Sentry wants 26$ a month if I want more than one user on my team - i'm sure people here know there are alternatives @workerbee22 but would rather not use them particularly once the flutter version matures

@ChaseGuru Sounds like you are we many of us have been. All setup correctly as per the doco, but nothing comes through.

But btw I have two older projects (pre flutter v1.12 setup) that work fully and correctly, which makes this even more frustrating, because newer projects I just cannot get to work and spent man-weeks trying.

So if/when you can't get it working because of this issue, I just suggested Sentry for the time being if you need something right now.

You are having the same issues as so many others but try this to try and debug your issues:
https://firebase.google.com/docs/crashlytics/force-a-crash?platform=android#enable_debug_logging

Or follow the progress of the new Beta SDK PR which hopefully will fix this issue: https://github.com/FirebaseExtended/flutterfire/pull/2288

A new Crashlytics plugin has now landed on master which should solve this issue.

Checkout the migration guide to get started on upgrading to the new Crashlytics plugin: https://firebase.flutter.dev/docs/migration/

I have the same probolem. Just migrated by instruction but still nothing shows up in the console.

EDIT: Nevermind, it works now.
Forgot to enable FirebaseCrashlytics.instance.setCrashlyticsCollectionEnabled(true);

Was this page helpful?
0 / 5 - 0 ratings