Get started with Firebase Crashlytics

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

ios
android

Before you begin

ios

To get started, you need a Firebase app with Firebase Crashlytics enabled:

android

To get started, you need a Firebase app with Firebase Crashlytics enabled:

Add the Crashlytics SDK to your project

ios

Add Crashlytics frameworks to your Xcode workspace

To get started, add the Crashlytics SDK framework files to your project. For most projects, the easiest way to do that is by adding the Crashlytics CocoaPods, but, if your project can't support CocoaPods, you can also add the files manually.

Add the Crashlytics run script

The frameworks you added include a run script that initializes Crashlytics. Add it to your project's build phases:

  1. Open your project in Xcode and select its project file in the Navigator.
  2. Open the Build Phases tab.
  3. Click + Add a new build phase, and select New Run Script Phase.
  4. Add the following line to the Type a script... text box:
    CocoaPods install
    "${PODS_ROOT}/Fabric/run"
    Manual install
    "${PROJECT_DIR}/Fabric.framework/run"

Once you've added the SDK to your app, Crashlytics automatically gets to work listening for and collecting crash reports.

Note: Make sure your new build phase is the project's last build phase, otherwise Crashlytics won't initialize properly.
android

Include the SDK in your build files

  1. Add the Crashlytics repositories and dependency to your project-level build.gradle file:
    buildscripts {
        repositories {
            // ...
            maven {
               url 'https://maven.fabric.io/public'
            }
        }
        dependencies {
            // ...
            classpath 'io.fabric.tools:gradle:1.24.4'
        }
    }
    
    allprojects { // ... repositories { // ... maven { url 'https://maven.google.com/' } } }
  2. Note: Crashlytics requires Google Services plugin version 3.1.2 or higher. Check the com.google.gms:google-services version number in your project's build.gradle dependencies.
  3. Add the Crashlytics dependencies to your app-level build.gradle:
    apply plugin: 'com.android.application'
    apply plugin: 'io.fabric'
    
    dependencies { // ... compile('com.crashlytics.sdk.android:crashlytics:2.7.1@aar') { transitive = true } compile 'com.google.firebase:firebase-core:11.4.2' }

Once you've added the SDK to your app, Crashlytics automatically gets to work listening for and collecting crash reports.

Note: If you're upgrading from Fabric Crashlytics, remove the Fabric API key from your AndroidManifest.xml. Delete the key's meta-data tag, which should have io.fabric.ApiKey and the API key.

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 non-fatal errors.

Send feedback about...

Need help? Visit our support page.