Crashlytics Setup Guide

Crashlytics is a powerful real-time crash reporting tool offered by Firebase. It helps developers identify, prioritize, and fix stability issues in mobile apps quickly. This guide will walk you through setting up Crashlytics in your Android and iOS applications.

1. Prerequisites

Before integrating Crashlytics, ensure you have the following:

2. Adding Firebase Crashlytics to Android

Follow these steps to integrate Crashlytics in your Android app:

  1. Add the Firebase Crashlytics Gradle plugin:
    buildscript {
        dependencies {
            classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.5'
        }
    }
  2. Apply the plugin in your app-level build.gradle:
    plugins {
        id 'com.android.application'
        id 'com.google.firebase.crashlytics'
    }
  3. Add the Crashlytics dependency:
    dependencies {
        implementation 'com.google.firebase:firebase-crashlytics:18.4.3'
    }
  4. Sync your Gradle project and rebuild the app.
  5. Enable Crashlytics in the Firebase Console under your project settings.

3. Adding Firebase Crashlytics to iOS

To integrate Crashlytics in an iOS app:

  1. Add Firebase via CocoaPods in your Podfile:
    pod 'Firebase/Crashlytics'
  2. Install pods:
    pod install
  3. Initialize Firebase in your AppDelegate.swift:
    import Firebase
    FirebaseApp.configure()
  4. Enable Crashlytics in the Firebase Console.
  5. Build and run your app to ensure Crashlytics is active.

4. Force a Test Crash

After setup, it’s good practice to generate a test crash to confirm integration:

5. Best Practices

6. Useful Links