Join us for Firebase Summit on November 10, 2021. Tune in to learn how Firebase can help you accelerate app development, release with confidence, and scale with ease. Register

Upgrade to the Firebase Crashlytics SDK

You can now set up Crashlytics in your app by using the new official Firebase Crashlytics SDK, which offers improved APIs that are more consistent with other Firebase products and more intuitive to use.

This guide describes how to upgrade to the new SDK from the legacy Fabric SDK. It describes the changes that come with the new APIs, the reason for the changes, and how to update your code, if required.

Before you begin

Fabric adds GameObjects to your Scene to initialize Crashlytics in your game as well as additional directories for the SDKs themselves.

To ensure there are no conflicts between the Fabric Crashlytics and Firebase Crashlytics plugins, remove the following Fabric folders and files from your Unity project:

  • Under Assets, delete the following files:

       Editor Default Resources/
           FabricSettings.asset     <- DELETE
       Fabric/                      <- DELETE
               answers/             <- DELETE
               beta/                <- DELETE
               crashlytics/         <- DELETE
               crashlytics-wrapper/ <- DELETE
               fabric/              <- DELETE
               fabric-init/         <- DELETE
               Fabric/              <- DELETE
  • In the Hierarchy Window, remove the following GameObjects

        Main Camera
        Directional Light
        FabricInit                  <- DELETE
        CrashlyticsInit             <- DELETE
  • Remove all Fabric entries in Assets > Plugins > Android > AndroidManifest.xml.

    For example, a known key to remove is: android:name=""

    Search and remove other Fabric entries if they exist.

Step 1: Add a Firebase configuration file

  1. Open your Project Settings. In the Your apps card, select the bundle ID or the package name of the app for which you need a config file.

  2. Download the platform-specific Firebase configuration file(s) for each app.

    • For iOSGoogleService-Info.plist
    • For Androidgoogle-services.json

    For a single Unity project, you can have at most two config files.

  3. In your Unity project, open the Project window, then move your config file(s) into the Assets folder.

Step 2: Add the Firebase Crashlytics SDK

  1. Download the Firebase Unity SDK, then unzip the SDK somewhere convenient.

    The Firebase Unity SDK is not platform-specific.

  2. In your open Unity project, navigate to Assets > Import Package > Custom Package.

  3. From the unzipped SDK, select to import the Crashlytics SDK (FirebaseCrashlytics.unitypackage). Make sure you have FirebaseCrashlytics.unitypackage version 6.15.0 or later (if not, update the Asset package version). This is required for your crash reports to appear in the Firebase console.

    • Unity 2017.x and later: Allow the use of the .NET 4.x framework. If your Unity project uses .NET 4.x, import dotnet4/FirebaseCrashlytics.unitypackage.

    Note that you can import any other supported Firebase product as well.

  4. In the Import Unity Package window, click Import.

  5. Create a new C# script, then add it to a GameObject in the scene.

    1. Open your first scene, then create an empty GameObject named CrashlyticsInitializer.

    2. Click Add Component in the Inspector for the new object.

    3. Select your CrashlyticsInit script to add it to the CrashlyticsInitializer object.

  6. Initialize Crashlytics in the script's Start method:

    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    // Import Firebase
    using Firebase;
    public class CrashlyticsInit : MonoBehaviour {
      // Use this for initialization
      void Start () {
          // Initialize Firebase
          Firebase.FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task => {
              var dependencyStatus = task.Result;
              if (dependencyStatus == Firebase.DependencyStatus.Available)
                  // Create and hold a reference to your FirebaseApp,
                  // where app is a Firebase.FirebaseApp property of your application class.
                  // Crashlytics will use the DefaultInstance, as well;
                  // this ensures that Crashlytics is initialized.
                  Firebase.FirebaseApp app = Firebase.FirebaseApp.DefaultInstance;
                  // Set a flag here for indicating that your project is ready to use Firebase.
                    "Could not resolve all Firebase dependencies: {0}",dependencyStatus));
                  // Firebase Unity SDK is not safe to use here.
    // Update is called once per frame
    void Update()
      // ...

With the SDK added and initialized, Crashlytics automatically gets to work listening for and collecting crash reports.

Step 3: Update your code

Review the following SDK changes and make the appropriate updates to your code:

Crashlytics now rotates IDs based on Firebase installation IDs

Crashlytics uses the Crashlytics Installation UUID to identify instances of your app and to associate your users' data with their devices. Previously, Crashlytics rotated your user's Installation UUID when the advertising ID of their device changed. Now, Crashlytics rotates the Installation UUID based on the user's Firebase installation ID (FID). For more information, visit Manage Firebase installation IDs.

Reason for change

Using FIDs is consistent with other Firebase SDKs.

Fabric.Crashlytics is now Firebase.Crashlytics

We've changed our namespace from Fabric to Firebase.


using Fabric.Crashlytics;


using Firebase.Crashlytics;

RecordCustomException is now LogException

Log custom non-fatal exceptions that were caught and handled.


Crashlytics.RecordCustomException(string name, string reason, StackTrace stackTrace);
Crashlytics.RecordCustomException(string name, string reason, string stackTraceString);


Crashlytics.LogException(Exception ex);

Reason for change

This function is most often used to log an instance of an Exception. Rather than requiring you to extract the "name", "reason", and "stackTrace" manually (which results in superfluous code), you can now provide the instance of the Exception and Firebase Crashlytics will extract the information that it needs.


If you were leveraging these parameters in a way other than just pulling the information directly off of an exception, you can still accomplish the previous behavior by creating your own Exception subclass with the custom metadata in its description.

SetKeyValue is now SetCustomKey

Set any key/value pair to send along with your crash report. Re-setting the same key will update the value.


Crashlytics.SetKeyValue(string key, string value);


Crashlytics.SetCustomKey(string key, string value);

Reason for change

This method is being renamed to make its behavior more clear and to improve consistency with other Firebase APIs.

SetUserIdentifier is now SetUserId

Set a user identifier to help understand which user experienced a crash.


Crashlytics.SetUserIdentifier(string identifier);


Crashlytics.SetUserId(string identifier);

Reason for change

This method is being renamed to improve consistency with other Firebase APIs. As a bonus, it's shorter; who doesn't love shaving off key strokes?

SetUserEmail and SetUserName are removed

Previously, you were allowed to set a name or email associated with a crash using explicit methods. These will no longer be explicitly defined.


Crashlytics.SetUserEmail(string email);
Crashlytics.SetUserName(string name);

Reason for change

Google strives to protect customer data, and part of that effort is designing APIs that do the same for developer tooling. These user-specific APIs have been removed to encourage the use of generated and non-personally identifying methods for discerning which user was affected by a crash.


To specify which user experienced a crash, the preferred method is to use SetUserId. However, if this is not a tenable solution, the same functionality can be accomplished using SetCustomKey.

Crash and ThrowNonFatal are removed

Previously, Crashlytics provided two utility methods to throw exceptions for testing purposes. These will not be included in Firebase Crashlytics.



Reason for change

Crashlytics for Unity runs in many different environments, and many different kinds of crashes can occur. These methods did not clearly specify whether the resulting crashes occurred in C# or in the underlying platform-specific native SDK.


  • Test your implementation by forcing a test crash that will send a crash report to the Crashlytics dashboard in the Firebase console.

Step 4: Build your project

  1. Export your project to iOS or to Android.

  2. After the export is complete, verify that the project exported correctly by comparing your exported project to the example export configurations below.



  3. If it seems like files are missing after comparing your project: open your Unity Editor, then run the Google Play Services Resolver (find the instructions just below).

(as needed) Run the resolver if files are missing after export

The Google Play Services Resolvers make sure that your Unity project has the appropriate dependencies for exporting your app to iOS or to Android. For more information on the resolver, visit the README for the Unity Jar Resolver.

Next steps