diff --git a/app/build.gradle b/app/build.gradle index 253c028b..00e58bbd 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -23,6 +23,8 @@ android { debug { def date = new Date().format('ddMMyy_HHmmss') archivesBaseName = archivesBaseName + "-$date" + // Disable fabric build ID generation for debug builds + ext.enableCrashlytics = false; } } diff --git a/app/src/main/java/gr/thmmy/mthmmy/base/BaseApplication.java b/app/src/main/java/gr/thmmy/mthmmy/base/BaseApplication.java index 34c6d2f9..6caa91d4 100644 --- a/app/src/main/java/gr/thmmy/mthmmy/base/BaseApplication.java +++ b/app/src/main/java/gr/thmmy/mthmmy/base/BaseApplication.java @@ -10,6 +10,8 @@ import android.support.v4.content.ContextCompat; import android.util.DisplayMetrics; import android.widget.ImageView; +import com.crashlytics.android.Crashlytics; +import com.crashlytics.android.core.CrashlyticsCore; import com.franmontiel.persistentcookiejar.PersistentCookieJar; import com.franmontiel.persistentcookiejar.cache.SetCookieCache; import com.franmontiel.persistentcookiejar.persistence.SharedPrefsCookiePersistor; @@ -31,6 +33,7 @@ import gr.thmmy.mthmmy.BuildConfig; import gr.thmmy.mthmmy.R; import gr.thmmy.mthmmy.session.SessionManager; import gr.thmmy.mthmmy.utils.CrashReportingTree; +import io.fabric.sdk.android.Fabric; import okhttp3.HttpUrl; import okhttp3.OkHttpClient; import okhttp3.Request; @@ -61,6 +64,13 @@ public class BaseApplication extends Application { super.onCreate(); baseApplication = this; //init singleton + // Set up Crashlytics, disabled for debug builds + Crashlytics crashlyticsKit = new Crashlytics.Builder() + .core(new CrashlyticsCore.Builder().disabled(BuildConfig.DEBUG).build()) + .build(); + // Initialize Fabric with the debug-disabled crashlytics. + Fabric.with(this, crashlyticsKit); + // Initialize timber if (BuildConfig.DEBUG) Timber.plant(new Timber.DebugTree()); else