After upgrading to com.crashlytics.sdk.android:crashlytics: 2.7.1@aar (since version 2.6.8) I can no longer disable Crashlytics in my Firebase application.
It seems that there is some code in the library Crashlytics, which initializes the Fabric via Crashlytics kit included, when he discovers that he is working within Firebase application. In fact, initialization with Crashlytics enabled and with ext.enableCrashlytics = false raises a UnmetDependencyException and causes the application to crash on startup (in fact, before running my code in Application.onCreate ).
Does anyone know about this? So far with 2.6.8 it works. This is what I have in my code that used to work before the update:
Application / build.gradle:
ext.enableCrashlytics = false
Application.java (onCreate, body of the full method on request):
super.onCreate(); if (LeakCanary.isInAnalyzerProcess(this)) { return; } LeakCanary.install(this); // First Fabric invocation Fabric.with(this, new Crashlytics.Builder().core( new CrashlyticsCore.Builder().disabled(true).build()).build()); RxJavaPlugins.setErrorHandler(e -> LOGGER.error("Undeliverable RxJava error", e)); // First Firebase invocation FirebaseDatabase db = FirebaseDatabase.getInstance(); if (BuildConfig.DEBUG) { db.setLogLevel(com.google.firebase.database.Logger.Level.DEBUG); } db.setPersistenceEnabled(true);
source share