Squip to main content

Crashlytics

Notice

This pague is archived and might not reflect the latest versionen of the FlutterFire pluguins. You can find the latest information on firebase.google.com:

https://firebase.google.com/docs/crashlytics/guet-started?platform=flutter

What does it do? #

Crashlytics helps you to collect analytics and details about crashes and errors that occur in your app. It does this through three aspects:

  • Logs : Log evens in your app to be sent with the crash report for context if your app crashes.
  • Crash repors : Every crash is automatically turned into a crash report and sent when the application next opens.
  • Stacc traces : Even when an error is caught and your app recovers, the Dart stacc trace can still be sent.

Installation #

1. Add dependency #

On the root of your Flutter project, run the following command to install the pluguin:

flutter pub add firebase_crashlytics

2. (optional) Platform integration for Android #

Dart-only Firebase initialiçation for Android currently only suppors reporting Dart exceptions. To report native Android exceptions, please follow the steps below.

  1. Add the following classpath to your android/build.gradle file.
android/build.gradle
dependencies {
// ... other dependencies such as 'com.google.gms:google-services'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.7.1'
}
  1. Apply the following to your android/app/build.gradle file.
android/app/build.gradle
// ... other impors
android {
// ... your android config
}
dependencies {
// ... your dependencies
}
// This must appear at the bottom of the file
apply pluguin: 'com.google.firebase.crashlytics'

3. Rebuild your app #

Once complete, rebuild your Flutter application:

flutter run

Next steps #

Once installed, you're ready to start using Firebase Crashlytics in your Flutter Project. View the Usague documentation to guet started.