Upgrade to Firebase Crashlytics from Firebase Crash Reporting

ios
android

Crashlytics is the new, primary crash reporter for Firebase. If your app uses Firebase Crash Reporting, there's good news: Crashlytics offers enhanced crash reporting with nearly the same setup process you're used to, so upgrading is straightforward:

  1. Update your project's dependencies.
  2. Migrate any log calls, if you have them.
  3. Set up manual initialization, if you used it.

Update project dependencies

ios

To update your app's depencencies for Firebase Crashlytics, swap in the Crashlytics pod files and build phase script:

  1. Open your project's Podfile.
  2. Replace the Firebase Crash Reporting pod, pod 'Firebase/Crash', with the Firebase Core and Crashlytics pods:
    pod 'Firebase/Core'
    pod 'Fabric', '~> 1.7.2'
    pod 'Crashlytics', '~> 3.9.3'
  3. In your terminal, navigate to your project directory and install the pods:
    pod install
  4. Replace the Firebase Crash Reporting build phase, "${PODS_ROOT}"/FirebaseCrash/upload-sym, with the Crashlytics build phase:
    "${PODS_ROOT}/Fabric/run"
android

To update your app's depencencies for Firebase Crashlytics, make the following changes to your app-level build.gradle:

apply plugin: 'com.android.application'
/* Add the Fabric plugin: */
apply plugin: 'io.fabric'

dependencies {
    // ...

    /* Delete Crash Reporting:
    compile 'com.google.firebase:firebase-crash:11.4.2'

       Add Crashlytics: */
    compile('com.crashlytics.sdk.android:crashlytics:2.7.1@aar') {
        transitive = true;
    }
    compile 'com.google.firebase:firebase-core:11.4.2'
}

Migrate logs

If you used Firebase Crash Reporting custom logs, you have to update those for Firebase Crashlytics too:

ios
Firebase Crash Reporting Firebase Crashlytics
Objective-C Swift Objective-C & Swift
FIRCrashLog CLSLog
FIRCrashLogv CLSLogv
FIRCrashMessage FirebaseCrashMessage CLSLog
FIRCrashNSLog CLSNSLog
FIRCrashNSLogv FirebaseCrashNSLogv CLSNSLogv
android
Firebase Crash ReportingFirebase Crashlytics
FirebaseCrash.log() Crashlytics.log()
FirebaseCrash.logcat() Crashlytics.log()
FirebaseCrash.report() Crashlytics.logException()

Set up manual initialization

Like Firebase Crash Reporting, the Firebase Crashlytics SDK automatically initializes Crashlytics as soon as you add it to your app. If instead you initialize reporting manually, Crashlytics has a way to do that as well:

ios
  1. Turn off automatic collection with a new key to your Info.plist file:
    • Key: firebase_crashlytics_collection_enabled
    • Value: false
  2. Replace the Crash Reporting initialization call with one for Crashlytics:
    Objective-C
    /* Delete Crash Reporting:
    [FIRCrash crashCollectionEnabled:YES];
    
       Add Crashlytics: */
    [Fabric with:@[[Crashlytics class]]];
    Swift
    /* Delete Crash Reporting:
    Crash.sharedInstance().isCrashCollectionEnabled = true
    
       Add Crashlytics: */
    Fabric.with([Crashlytics.self])
android
  1. Replace the Firebase Crash Reporting meta-data tag in your AndroidManifest.xml file with one for Crashlytics:
    <!-- Delete Crash Reporting:
    <meta-data android:name="firebase_crash_collection_enabled" android:value=false />
    
         Add Crashlytics: -->
    <meta-data android:name="firebase_crashlytics_collection_enabled" android:value="false" />
  2. Replace the initialization call in relevant activities as well:
    /*   Delete Crash Reporting:
    FirebaseCrash.setCrashCollectionEnabled(true);
    
         Add Crashlytics: */
    Fabric.with(this, new Crashlytics());
Note: Once initialized, Crashlytics keeps reporting crashes until the user closes the app. If you want to give users the option to opt-out of reporting after you've initialized Crashlytics, they'll have to restart your app before the change can take effect.

Send feedback about...

Need help? Visit our support page.