firebase_crashlytics 0.0.4+11

firebase_crashlytics plugin #

A Flutter plugin to use the Firebase Crashlytics Service.

pub package

For Flutter plugins for other Firebase products, see

Note: This plugin is still under development, and some APIs might not be available yet. Feedback and Pull Requests are most welcome!

Usage #

Import the firebase_crashlytics plugin #

To use the firebase_crashlytics plugin, follow the plugin installation instructions.

Android integration #

Enable the Google services by configuring the Gradle scripts as such.

  1. Add Fabric repository to the [project]/android/build.gradle file.
repositories {
  // Additional repository for fabric resources
  maven {
    url ''
  1. Add the classpaths to the [project]/android/build.gradle file.
dependencies {
  // Example existing classpath
  classpath ''
  // Add the google services classpath
  classpath ''
  // Add fabric classpath
  classpath ''
  1. Add the apply plugins to the [project]/android/app/build.gradle file.
apply plugin: 'io.fabric'
apply plugin: ''

Note: If this section is not completed you will get an error like this:

Default FirebaseApp is not initialized in this process [package name].
Make sure to call FirebaseApp.initializeApp(Context) first.

Note: When you are debugging on Android, use a device or AVD with Google Play services. Otherwise you will not be able to use Firebase Crashlytics.

iOS Integration #

Add the Crashlytics run scripts

  1. From Xcode select Runner from the project navigation.
  2. Select the Build Phases tab.
  3. Click + Add a new build phase, and select New Run Script Phase.
  4. Add ${PODS_ROOT}/Fabric/run to the Type a script... text box.
  5. If on Xcode 10 Add your app's built Info.plist location to the Build Phase's Input Files field. Eg: $(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)

Use the plugin #

Add the following imports to your Dart code:

import 'package:firebase_crashlytics/firebase_crashlytics.dart';

Setup Crashlytics:

void main() {
  // Set `enableInDevMode` to true to see reports while in debug mode
  // This is only to be used for confirming that reports are being
  // submitted as expected. It is not intended to be used for everyday
  // development.
  Crashlytics.instance.enableInDevMode = true;

  // Pass all uncaught errors to Crashlytics.
  FlutterError.onError = (FlutterErrorDetails details) {

Result #

If an error is caught, you should see the following messages in your logs:

flutter: Error caught by Crashlytics plugin:
flutter: Error reported to Crashlytics.

Note: It may take awhile (up to 24 hours) before you will be able to see the logs appear in your Firebase console.

Example #

See the example application source for a complete sample app using the Firebase Crashlytics.

Issues and feedback #

Please file issues to send feedback or report a bug. Thank you!

0.0.4+11 #

  • Fixed an issue where Crashlytics#getStackTraceElements didn't handle functions without classes.

0.0.4+10 #

  • Update README.

0.0.4+9 #

  • Fixed custom keys implementation.
  • Added tests for custom keys implementation.
  • Removed a print statement.

0.0.4+8 #

  • Automatically use version from pubspec.yaml when reporting usage to Firebase.

0.0.4+7 #

  • Fixed an issue where Crashlytics#setUserIdentifier incorrectly called setUserEmail on iOS.

0.0.4+6 #

  • On Android, use actual the Dart exception name instead of "Dart error."

0.0.4+5 #

  • Fix parsing stacktrace.

0.0.4+4 #

  • Add missing template type parameter to invokeMethod calls.
  • Bump minimum Flutter version to 1.5.0.

0.0.4+3 #

  • Migrate our handling of FlutterErrorDetails to work on both Flutter stable and master.

0.0.4+2 #

  • Keep debug log formatting.

0.0.4+1 #

  • Added an integration test.

0.0.4 #

  • Initialize Fabric automatically, preventing crashes that could occur when setting user data.

0.0.3 #

  • Rely on firebase_core to add the Android dependency on Firebase instead of hardcoding the version ourselves.

0.0.2+1 #

  • Update variable name enableInDevMode in README.

0.0.2 #

  • Updated the iOS podspec to a static framework to support compatibility with Swift plugins.
  • Updated the Android gradle dependencies to prevent build errors.

0.0.1 #

  • Initial release of Firebase Crashlytics plugin. This version reports uncaught errors as non-fatal exceptions in the Firebase console.


firebase_crashlytics_example #

Demonstrates how to use the firebase_crashlytics plugin.

Getting Started #

Add your own Firebase project #

This example initially uses a default project for CI purposes. You must replace the default project with your own so that you can review the error reports submitted to the Firebase console.

See docs for how to add Firebase to a Flutter project.

For further 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:

  firebase_crashlytics: ^0.0.4+11

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:firebase_crashlytics/firebase_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 Jul 15, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.4.0
  • pana: 0.12.19
  • Flutter: 1.7.8+hotfix.3


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-dev.68.0 <3.0.0
flutter 0.0.0
stack_trace ^1.9.3 1.9.3
Transitive dependencies
collection 1.14.11
meta 1.1.6 1.1.7
path 1.6.2
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
test ^1.5.1