Flutterfire: 🐛 [firebase_crashlytics] Crashes are not being reported in dashboard for release mode

Created on 19 Nov 2020  ·  7Comments  ·  Source: FirebaseExtended/flutterfire

Bug report

Crash/Error not being reported in Firebase Console for Release Apps
I created a new project to test out the firebase_crashlytics since I was having a problem with one of the existing project where errors are not being reported to the console in release mode, to my surprise for the newly created project also errors are not being reported in release mode.

After doing to initial project setup and manually crashing the app and reopening the app in the release mode, I headed over to the firebase crashlytics console where it was just showing We’ll be listening for your app to communicate with our servers even after crashing multiple times, now if I run the project in release mode errors are caught on the console.

note: In the entire process FirebaseCrashlytics.instance.setCrashlyticsCollectionEnabled(true); is set to true and still errors are reported only in the debug mode.

Steps to reproduce

Steps to reproduce the behavior:

  1. Create a new project using flutter create command
  2. Set up the project to use firebase
  3. Add latest firebase_core and firebase_crashlytics from pub.dev
  4. Delete the existing code in main.dart file and add the code from the official example app
  5. Run the project using flutter run --release or build the release apk and install
  6. Manually crash the app by pressing the buttons available on the home screen of the app.
  7. Reopen the App
  8. Open the Crashlytics option available Firebase Console, it says We’ll be listening for your app to communicate with our servers even after crashing multiple times in release mode.
  9. Run the project in debug mode using flutter run command
  10. Crash the app manually from the buttons available on the home screen and reopen the app.
  11. Now Crashlytics will report the errors caused on the app

Expected behavior

Crashes should be reported in release mode.


Additional context

  1. I have tried using both of the methods mentioned here
  2. I have tested this on multiple android devices.

Flutter doctor

Run flutter doctor and paste the output below:

Click To Expand

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 1.22.0, on Mac OS X 10.15.7 19H2, locale en-IN)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 11.5)
[✓] Android Studio (version 4.0)
[✓] VS Code (version 1.51.1)
[✓] Connected device (2 available)


Flutter dependencies

Run flutter pub deps -- --style=compact and paste the output below:

Click To Expand

```
Dart SDK 2.10.0
Flutter SDK 1.22.0
fire 1.0.0+1

dependencies:

  • cupertino_icons 1.0.0
  • firebase_core 0.5.2 [firebase_core_platform_interface flutter quiver meta firebase_core_web]
  • firebase_crashlytics 0.2.3 [flutter stack_trace firebase_core firebase_core_platform_interface firebase_crashlytics_platform_interface]
  • flutter 0.0.0 [characters collection meta typed_data vector_math sky_engine]

dev dependencies:

  • flutter_test 0.0.0 [flutter test_api path fake_async clock stack_trace vector_math async boolean_selector characters charcode collection matcher meta source_span stream_channel string_scanner term_glyph typed_data]

transitive dependencies:

  • async 2.5.0-nullsafety.1 [collection]
  • boolean_selector 2.1.0-nullsafety.1 [source_span string_scanner]
  • characters 1.1.0-nullsafety.3
  • charcode 1.2.0-nullsafety.1
  • clock 1.1.0-nullsafety.1
  • collection 1.15.0-nullsafety.3
  • fake_async 1.2.0-nullsafety.1 [clock collection]
  • firebase_core_platform_interface 2.0.0 [flutter meta plugin_platform_interface quiver]
  • firebase_core_web 0.2.1 [firebase_core_platform_interface flutter flutter_web_plugins meta js]
  • firebase_crashlytics_platform_interface 1.1.3 [flutter meta collection firebase_core plugin_platform_interface]
  • flutter_web_plugins 0.0.0 [flutter characters collection meta typed_data vector_math]
  • js 0.6.2
  • matcher 0.12.10-nullsafety.1 [stack_trace]
  • meta 1.3.0-nullsafety.3
  • path 1.8.0-nullsafety.1
  • plugin_platform_interface 1.0.3 [meta]
  • quiver 2.1.5 [matcher meta]
  • sky_engine 0.0.99
  • source_span 1.8.0-nullsafety.2 [charcode collection path term_glyph]
  • stack_trace 1.10.0-nullsafety.1 [path]
  • stream_channel 2.1.0-nullsafety.1 [async]
  • string_scanner 1.1.0-nullsafety.1 [charcode source_span]
  • term_glyph 1.2.0-nullsafety.1
  • test_api 0.2.19-nullsafety.2 [async boolean_selector collection meta path source_span stack_trace stream_channel string_scanner term_glyph matcher]
  • typed_data 1.3.0-nullsafety.3 [collection]
  • vector_math 2.1.0-nullsafety.3```


crashlytics bug

Most helpful comment

Yes basically it doesn't work in release mode, I tried in the master branch after you mentioned and still no luck
also, I get this strange error in debug mode.

W/ConnectionTracker(21276): Exception thrown while unbinding W/ConnectionTracker(21276): java.lang.IllegalArgumentException: Service not registered: lp@7bcf630 W/ConnectionTracker(21276): at android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java:1766) W/ConnectionTracker(21276): at android.app.ContextImpl.unbindService(ContextImpl.java:1810) W/ConnectionTracker(21276): at android.content.ContextWrapper.unbindService(ContextWrapper.java:741) W/ConnectionTracker(21276): at ci.f(:com.google.android.gms.dynamite_measurementdynamite@[email protected] (120400-0):1) W/ConnectionTracker(21276): at ci.d(:com.google.android.gms.dynamite_measurementdynamite@[email protected] (120400-0):2) W/ConnectionTracker(21276): at lq.D(:com.google.android.gms.dynamite_measurementdynamite@[email protected] (120400-0):10) W/ConnectionTracker(21276): at lc.a(:com.google.android.gms.dynamite_measurementdynamite@[email protected] (120400-0):2) W/ConnectionTracker(21276): at ee.run(:com.google.android.gms.dynamite_measurementdynamite@[email protected] (120400-0):3) W/ConnectionTracker(21276): at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462) W/ConnectionTracker(21276): at java.util.concurrent.FutureTask.run(FutureTask.java:266) W/ConnectionTracker(21276): at ix.run(:com.google.android.gms.dynamite_measurementdynamite@[email protected] (120400-0):6)

Im not sure if it is related to this(tried solving this by addingcom.google.android.gms:play-services-basement:17.5.0 in build.gradle but these errors will still showup)

All 7 comments

Hi @LaxmikanthMadhyastha
Is the issue that FirebaseCrashlytics.instance.setCrashlyticsCollectionEnabled(true); is required for crashlytics collection to work? The official example already includes a section to enable it by default.
Could you elaborate on the expected vs actual behavior here? From your description reporting does work when collection is enabled.
Thank you

Hi @markusaksli-nc thanks for the reply,
I'm really sorry for not being clear there, what I'm trying to say is that irrespective of what the value for setCrashlyticsCollectionEnabled is, errors are not being reported in the release mode, for example, if I keep setCrashlyticsCollectionEnabled to always true without checking to debug mode or not, I expect the crash to report on the dashboard for both release and debug mode but what is happening is crashes are reported only if I run in debug mode.

This can be reproduced using the official example app also.

PS: I have updated the question for further clarification.

Thank you.

To be clear. This is just on Android so far and doesn't work at all (rather than just the first time setting up crashlytics in console)?

It works fine for me on the latest master 1.24.0-8.0.pre.304 with firebase_crashlytics: ^0.2.3 after installing a release apk.


flutter doctor -v

[√] Flutter (Channel master, 1.24.0-8.0.pre.304, on Microsoft Windows [Version 10.0.19041.630], locale et-EE)
    • Flutter version 1.24.0-8.0.pre.304 at C:\Development\flutter_master
    • Framework revision c6290500f8 (6 hours ago), 2020-11-18 17:29:28 -0800
    • Engine revision 35a0b9fe68
    • Dart version 2.12.0 (build 2.12.0-50.0.dev)

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at C:\Users\marku\AppData\Local\Android\sdk
    • Platform android-30, build-tools 30.0.2
    • Java binary at: C:\Users\marku\AppData\Local\JetBrains\Toolbox\apps\AndroidStudio\ch-0\201.6953283\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.7.7)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
    • Visual Studio Community 2019 version 16.7.30621.155
    • Windows 10 SDK version 10.0.18362.0

[√] Android Studio (version 4.1.0)
    • Android Studio at C:\Users\marku\AppData\Local\JetBrains\Toolbox\apps\AndroidStudio\ch-0\201.6953283
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[√] IntelliJ IDEA Ultimate Edition (version 2020.2)
    • IntelliJ at C:\Users\marku\AppData\Local\JetBrains\Toolbox\apps\IDEA-U\ch-0\202.7660.26
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart

[√] Connected device (4 available)
    • Windows (desktop) • windows    • windows-x64    • Microsoft Windows [Version 10.0.19041.630]
    • Web Server (web)  • web-server • web-javascript • Flutter Tools
    • Chrome (web)      • chrome     • web-javascript • Google Chrome 86.0.4240.198
    • Edge (web)        • edge       • web-javascript • Microsoft Edge 86.0.622.68

• No issues found!

Yes basically it doesn't work in release mode, I tried in the master branch after you mentioned and still no luck
also, I get this strange error in debug mode.

W/ConnectionTracker(21276): Exception thrown while unbinding W/ConnectionTracker(21276): java.lang.IllegalArgumentException: Service not registered: lp@7bcf630 W/ConnectionTracker(21276): at android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java:1766) W/ConnectionTracker(21276): at android.app.ContextImpl.unbindService(ContextImpl.java:1810) W/ConnectionTracker(21276): at android.content.ContextWrapper.unbindService(ContextWrapper.java:741) W/ConnectionTracker(21276): at ci.f(:com.google.android.gms.dynamite_measurementdynamite@[email protected] (120400-0):1) W/ConnectionTracker(21276): at ci.d(:com.google.android.gms.dynamite_measurementdynamite@[email protected] (120400-0):2) W/ConnectionTracker(21276): at lq.D(:com.google.android.gms.dynamite_measurementdynamite@[email protected] (120400-0):10) W/ConnectionTracker(21276): at lc.a(:com.google.android.gms.dynamite_measurementdynamite@[email protected] (120400-0):2) W/ConnectionTracker(21276): at ee.run(:com.google.android.gms.dynamite_measurementdynamite@[email protected] (120400-0):3) W/ConnectionTracker(21276): at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462) W/ConnectionTracker(21276): at java.util.concurrent.FutureTask.run(FutureTask.java:266) W/ConnectionTracker(21276): at ix.run(:com.google.android.gms.dynamite_measurementdynamite@[email protected] (120400-0):6)

Im not sure if it is related to this(tried solving this by addingcom.google.android.gms:play-services-basement:17.5.0 in build.gradle but these errors will still showup)

That is a known issue https://github.com/FirebaseExtended/flutterfire/issues/4090

Are any other error messages thrown when trying to set up crashlytics or at startup in general? Is this on emulator or physical?

No there are no other issues and I have tried this on Oneplus7Pro and Redmi note 6 Pro.

Labeling this because I'm not sure at this point what more could cause this.

Was this page helpful?
0 / 5 - 0 ratings