pushstrength_flutter_crashlytics 0.0.3

  • Readme
  • Changelog
  • Example
  • Installing
  • 79


This is an experimental fork of flutter_crashlytics that may not be fully stable. For the full experiance please look for flutter_crashlytics here: https://pub.dartlang.org/packages/flutter_crashlytics

flutter_crashlytics #

Flutter plugin to enable Crashlytics reporting.

Setup #

Firebase Crashlytics #

If using Firebase instead of Fabric, you must first setup your app to use firebase as per this tutorial https://codelabs.developers.google.com/codelabs/flutter-firebase/#4

The instructions are the same for Fabric and Firebase, except that for Firebase, you do not get an Api key so you do not have to add it anywhere.

Android #

To setup Crashlytics on Android side, you need to set under your manifest the Fabric ID like: (Only do this if using Fabric, not firebase as you will not have an Api Key)

            android:value="YOUR_ID_HERE" />

You also need to change you build.gradle file like:

buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'

And apply the fabric plugin apply plugin: 'io.fabric'

Nothing more.

iOS #

On iOS side your need to set your Fabric ID under your Info.plist like: (Only do this if using Fabric, not Firebase as you will not have an Api Key)


Turn off automatic collection with a new key to your Info.plist file (GDPR compliency if you want it):

Key: firebase_crashlytics_collection_enabled

Value: false

Don't forget to add your Run Script step (with any version of Xcode) on the build phases tab. If using Xcode 10, you also must you add your app's built Info.plist location to the Build Phase's Input Files field:


ios run script

That's it :)

Flutter #

All you need to do under your code is to let the plugin handle the Flutter crashes.

Your main method should look like:

void main() async {
  bool isInDebugMode = false;

  FlutterError.onError = (FlutterErrorDetails details) {
    if (isInDebugMode) {
      // In development mode simply print to console.
    } else {
      // In production mode report to the application zone to report to
      // Crashlytics.
      Zone.current.handleUncaughtError(details.exception, details.stack);

  await FlutterCrashlytics().initialize();

  runZoned<Future<Null>>(() async {
  }, onError: (error, stackTrace) async {
    // Whenever an error occurs, call the `reportCrash` function. This will send
    // Dart errors to our dev console or Crashlytics depending on the environment.
    await FlutterCrashlytics().reportCrash(error, stackTrace, forceCrash: false);

forceCrash allow you to have a real crash instead of the red screen, in that case the exception will tagged as fatal

API available #

  • Add log to crash reporting with log(String msg, {int priority, String tag})
  • Add manual log to crash reporting with logException(Error/Exception exception, Stacktrace stack)
  • Add user info to crash reporting with setUserInfo(String identifier, String email, String name)
  • Add general info to crash reporting with setInfo(String key, dyncamic value)

Limitation #

This plugin uses Crashlytics sdk to log manually dart crashes, all manual logged crashes are tagged as non fatal under Crashlytics, that's a limitation of the SDK.

You can bypass that limitation with the forceCrash parameter, instead of the red screen an actual crash will append, the crash will be tagged as Fatal.

On iOS fatal crash has there dart stacktrace under the Logs tab of Crashlytics, that's a limitation of iOS that prevent developers to set a custom stacktrace to an exception.

Contribution #

We love contributions! Don't hesitate to open issues and make pull request to help improve this plugin.

0.2.1 #

  • Dependencies updated (crashlytics 2.9.8, gradle 3.3.0, kotlin 1.3.20)

0.2.0 #

  • move from swift to obj-c

0.1.3 #

  • fix android background execution

0.1.2 #

  • fix iOS custom log

0.1.0 #

  • Breaking change, now initialize method need to be called in order to init Fabric (GDPR compliance)
  • fix crash when stacktrace is null for some reason...
  • fix crash when line number is null

0.0.6 #

  • add manual log for Error/Exception
  • support for Zone

0.0.5 #

  • fix empty crash report in release mode.

0.0.4 #

  • add ability to force a crash when a flutter exception append to force a fatal error.

0.0.3 #

  • update package info.

0.0.2 #

  • enable SDK dart 2.

0.0.1 #

  • initial release.



This is an experimental fork of flutter_crashlytics that may not be fully stable. For the full experiance please look for flutter_crashlytics here: https://pub.dartlang.org/packages/flutter_crashlytics

flutter_crashlytics_example #

Demonstrates how to use the flutter_crashlytics plugin.

Getting Started #

For help getting started with Flutter, view our online documentation.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  pushstrength_flutter_crashlytics: ^0.0.3

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:pushstrength_flutter_crashlytics/pushstrength_flutter_crashlytics.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Oct 22, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.1
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.4


Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Maintenance suggestions

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
flutter 0.0.0
stack_trace ^1.9.3 1.9.3
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.7
path 1.6.4
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8