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

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

2. 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. Select your main build target from the Select a project or target dropdown.
  3. Open the target's Build Phases tab.
  4. Click + Add a new build phase, and select New Run Script Phase.
  5. Add the following line to the Type a script... text box:
    CocoaPods install
    "${PODS_ROOT}/Fabric/run"
    Manual install
    "${PROJECT_DIR}/Fabric.framework/run"
  6. Xcode 10 only: Add your app's built Info.plist location to the Build Phase's Input Files field:
    $(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)

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

android

Include the SDK in your build files

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

    buildscript {
        repositories {
            // ...
    
            // Add repository
            maven {
               url 'https://maven.fabric.io/public'
            }
        }
        dependencies {
            // ...
    
            // Check for v3.1.2 or higher
            classpath 'com.google.gms:google-services:4.2.0'
    
            // Add dependency
            classpath 'io.fabric.tools:gradle:1.26.1'
        }
    }
    
    allprojects { // ... repositories { // ... // Add repository maven { url 'https://maven.google.com/' } } }

  2. In your app-level build.gradle, update your firebase-core to v11.4.2 or higher, and add the Crashlytics dependencies:

    apply plugin: 'com.android.application'
    apply plugin: 'io.fabric'
    
    dependencies { // ... // Check for v11.4.2 or higher implementation 'com.google.firebase:firebase-core:16.0.6' // Add dependency implementation 'com.crashlytics.sdk.android:crashlytics:2.9.7' }

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

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.