Crashlytics deprecated method disabled()

The Fabric Crashlytics SDK is now deprecated and FirebaseCrashlytics should be used

// Explicit initialization of Crashlytics is no longer required.
// OPTIONAL: If crash reporting has been explicitly disabled previously, add:
FirebaseCrashlytics.getInstance().setCrashlyticsCollectionEnabled(!BuildConfig.DEBUG);

See the migration documentation here


Mike from Crashlytics and Fabric here.

Here's what you want to use depending on your preference:

CrashlyticsCore core = new CrashlyticsCore.Builder().disabled(BuildConfig.DEBUG).build();
Fabric.with(this, new Crashlytics.Builder().core(core).build());

or

Fabric.with(this, new Crashlytics.Builder().core(new CrashlyticsCore.Builder().disabled(BuildConfig.DEBUG).build()).build());

See CrashlyticsCore.Builder#disabled documentation.