Konsola git

Get started with Firebase Crashlytics

This quickstart describes how to set up Firebase Crashlytics so that you can get comprehensive crash reports in the Firebase console.

Before you begin

Before you can set up Crashlytics, you need to register your Android app and configure it to use Firebase.

  • If your Android app already uses Firebase, then it's already registered and configured for Firebase.

  • If you don't have an Android app, you can download a sample app.

    Note that adding Firebase to your Android app involves tasks both in the Firebase console and in your open Android project (for example, you download Firebase config files from the console, then move them into your Android project).

Step 1: Set up Crashlytics in the Firebase console

  1. Click Crashlytics in the left-hand nav panel of the Firebase console.

  2. If your Firebase project has multiple apps registered in it, select the app you just added from the dropdown next to Crashlytics in the top bar of the console.

  3. Click Set up Crashlytics.

  4. Select This app is new to Crashlytics (it doesn't have any version of the SDK).

Step 2: Add the Crashlytics SDK

  1. In your project-level build.gradle, update your google-services to version 3.1.2 or later, then add the Crashlytics repositories and dependency:

    buildscript {
        repositories {
            // Add the following repositories:
            google()  // Google's Maven repository
            maven {
               url 'https://maven.fabric.io/public'
        dependencies {
            // ...
            // Check for v3.1.2 or higher
            classpath 'com.google.gms:google-services:4.3.2'  // Google Services plugin
            // Add dependency
            classpath 'io.fabric.tools:gradle:1.31.1'  // Crashlytics plugin
    allprojects { // ... repositories { // Check that you have the following line (if not, add it): google() // Google's Maven repository // ... } }

  2. In your app-level build.gradle, add the Crashlytics dependencies:

    apply plugin: 'com.android.application'
    apply plugin: 'io.fabric'
    dependencies { // ... // (Recommended) Add Analytics implementation 'com.google.firebase:firebase-analytics:17.2.0' // Add dependency implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1' }

  3. (Optional for apps using NDK) If your app uses Android native libraries, you can configure Crashlytics to report crashes from your NDK libraries. For more instructions, see Get Android NDK crash reports.

    After you add the SDK to your app, Crashlytics automatically gets to work listening for and collecting crash reports.

Step 3: Initialize Crashlytics

The Firebase Crashlytics SDK automatically initializes Crashlytics as soon as you add it to your app.

Step 4: Build or run your project

Run your app to send verification to Firebase that you've successfully integrated Firebase.

Your device logs will display the Firebase verification that initialization is complete. If you ran your app on an emulator that has network access, the Firebase console notifies you that your app connection is complete.

Watch a video tutorial

For detailed guidance on getting started with Crashlytics, watch the following video tutorial:

You can find more videos on the Firebase YouTube channel.

Next steps

  • Test your implementation— Test your Crashlytics setup by forcing a crash to generate a crash report in the Firebase console.

  • Customize crash reports— Crashlytics automatically starts collecting crash reports as soon as you add the SDK, but you can also customize your setup by adding opt-in reporting, logs, keys, and even tracking of non-fatal errors.