From d65e4b6eb15388a8b9e3bb12b70054df24728a5c Mon Sep 17 00:00:00 2001 From: Thodoris1999 Date: Thu, 30 Aug 2018 20:56:20 +0300 Subject: [PATCH] crashlytics issue fix --- app/build.gradle | 2 ++ .../java/gr/thmmy/mthmmy/base/BaseApplication.java | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/app/build.gradle b/app/build.gradle index dd59ec42..af53a641 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 95a1ab1d..6a1b7baa 100644 --- a/app/src/main/java/gr/thmmy/mthmmy/base/BaseApplication.java +++ b/app/src/main/java/gr/thmmy/mthmmy/base/BaseApplication.java @@ -9,6 +9,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; @@ -30,6 +32,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.Interceptor; import okhttp3.OkHttpClient; @@ -59,6 +62,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 {