firebase_crashlytics 0.0.4+2

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 95

firebase_crashlytics plugin #

A Flutter plugin to use the Firebase Crashlytics Service.

pub package

For Flutter plugins for other Firebase products, see FlutterFire.md.

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 {
  google()
  jcenter()
  // Additional repository for fabric resources
  maven {
    url 'https://maven.fabric.io/public'
  }
}
  1. Add the classpaths to the [project]/android/build.gradle file.
dependencies {
  // Example existing classpath
  classpath 'com.android.tools.build:gradle:3.2.1'
  // Add the google services classpath
  classpath 'com.google.gms:google-services:4.2.0'
  // Add fabric classpath
  classpath 'io.fabric.tools:gradle:1.26.1'
}
  1. Add the apply plugins to the [project]/android/app/build.gradle file.
// ADD THIS AT THE BOTTOM
apply plugin: 'io.fabric'
apply plugin: 'com.google.gms.google-services'

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

java.lang.IllegalStateException:
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) {
    Crashlytics.instance.onError(details);
  };
  runApp(MyApp());
}

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+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.

example/README.md

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:


dependencies:
  firebase_crashlytics: ^0.0.4+2

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

Alternatively, your editor might support flutter packages 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';
  
Version Uploaded Documentation Archive
0.0.4+2 Apr 15, 2019 Go to the documentation of firebase_crashlytics 0.0.4+2 Download firebase_crashlytics 0.0.4+2 archive
0.0.4+1 Apr 5, 2019 Go to the documentation of firebase_crashlytics 0.0.4+1 Download firebase_crashlytics 0.0.4+1 archive
0.0.4 Apr 5, 2019 Go to the documentation of firebase_crashlytics 0.0.4 Download firebase_crashlytics 0.0.4 archive
0.0.2+1 Apr 4, 2019 Go to the documentation of firebase_crashlytics 0.0.2+1 Download firebase_crashlytics 0.0.2+1 archive
0.0.2 Mar 22, 2019 Go to the documentation of firebase_crashlytics 0.0.2 Download firebase_crashlytics 0.0.2 archive
0.0.1 Mar 20, 2019 Go to the documentation of firebase_crashlytics 0.0.1 Download firebase_crashlytics 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
93
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
95
Learn more about scoring.

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

  • Dart: 2.2.0
  • pana: 0.12.14
  • Flutter: 1.4.7

Platforms

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.

Dependencies

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
flutter_driver
flutter_test
test ^1.5.1