The correct Fabric.io initialization method for debugging / release

Just a quick Crashlytics question from Fabric.io:

To disable it during debugging, we should use:

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

Or Fabric handles the debug / release difference, and we should just use:

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

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

+6
source share
3 answers

With the new version 2.3. + you should use somenthing as follows:

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

Try it.

 Fabric.Builder.debuggable(boolean) 

Java Doc Crashlytics API

setDebugMode (logical debugging) Deprecated. use Fabric.Builder.debuggable (boolean) instead

UPDATED

For more information visit SO - CrashLytics Deprecated

+2
source

Another option is to have a debug version of the application: https://www.littlerobots.nl/blog/stetho-for-android-debug-builds-only/

Basically, you need to have a debug version of your Application in the debug folder with the debugged version of Fabric along with a manifest file that will address your DebugApp:

 <manifest package="com.mycompany" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools"> <application tools:replace="android:name" android:name=".DebugApp"/> </manifest> 
0
source

Source: https://habr.com/ru/post/988922/


All Articles