Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Proper way to initialize Fabric.io for debugging/release

Just a quick question about Crashlytics from Fabric.io:

To disable it in debug, should we still use:

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

Or does Fabric handle the debug/release difference and should we just use:

Fabric.with(this, new Crashlytics());

The disabled method is depricated and if you use the Fabric plugin in Android Studio, it always changes the crashlytics instance to new Crashlytics().

like image 744
TomCB Avatar asked Jun 11 '15 12:06

TomCB


1 Answers

With the new 2.3.+ version you should use somenthing like this:

Fabric.with(this, new Crashlytics.Builder()
            .core(new CrashlyticsCore.Builder()
                    .disabled(BuildConfig.DEBUG)
                    .build())
            .build());
like image 176
Gabriele Mariotti Avatar answered Nov 15 '22 09:11

Gabriele Mariotti