javaandroidfirebasecrashlyticsgoogle-fabric

How do I convert a Fabric-based Crashlytics code to Firebase-based Crashlytics code?


I am developing my android project for my university, a medicine ordering app. I was following a tutorial to make the LoginActivity based on Firebase authentication and using Firebase database. The tutorial uses the Fabric Crashlytics instead of Firebase Crashlytics. I have already integrated the Firebase Crashlytics in my project using Firebase Assistant, but I am unable to figure out how to write the tutorial's code using Firebase Crashlytics.

I tried hard to find how to convert the code to Firebase Crashlytics, but everywhere they have told the procedure to migrate from Fabric Project to Firbase Project, which is not my case.

The Fabric-based Crashlytics code I want to be converted in Firebase-based Crashlytics code is below:

import android.app.Application;

import com.crashlytics.android.Crashlytics;
import com.crashlytics.android.core.CrashlyticsCore;
import com.digits.sdk.android.Digits;

import com.twitter.sdk.android.core.TwitterAuthConfig;
import com.twitter.sdk.android.core.TwitterCore;

import io.fabric.sdk.android.Fabric;
import timber.log.Timber;

public class App extends Application {
    .
    .
    .

    @Override
    public void onCreate() {
        .
        .
        .
        // Fabric initialization
        Crashlytics crashlyticsKit = new Crashlytics.Builder()
                .core(new CrashlyticsCore.Builder().disabled(BuildConfig.DEBUG).build())
                .build();

        Fabric.with(this, new TwitterCore(authConfig), new Digits(), crashlyticsKit);

        if (BuildConfig.DEBUG) {
            Timber.plant(new Timber.DebugTree());
        }

        Timber.plant(new CrashlyticsTree());

    }
.
.
.
}

Solution

  • I just found out that we don't need to initialize the Firebase Crashlytics as we used to do for Fabric Crashlytics. Just integrate the Firebase Crashlytics using Firebase Assistant and it will do the rest automatically.