Browse Source

crashlytics issue fix

pull/46/head
Thodoris1999 6 years ago
parent
commit
d65e4b6eb1
  1. 2
      app/build.gradle
  2. 10
      app/src/main/java/gr/thmmy/mthmmy/base/BaseApplication.java

2
app/build.gradle

@ -23,6 +23,8 @@ android {
debug { debug {
def date = new Date().format('ddMMyy_HHmmss') def date = new Date().format('ddMMyy_HHmmss')
archivesBaseName = archivesBaseName + "-$date" archivesBaseName = archivesBaseName + "-$date"
// Disable fabric build ID generation for debug builds
ext.enableCrashlytics = false;
} }
} }

10
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.util.DisplayMetrics;
import android.widget.ImageView; import android.widget.ImageView;
import com.crashlytics.android.Crashlytics;
import com.crashlytics.android.core.CrashlyticsCore;
import com.franmontiel.persistentcookiejar.PersistentCookieJar; import com.franmontiel.persistentcookiejar.PersistentCookieJar;
import com.franmontiel.persistentcookiejar.cache.SetCookieCache; import com.franmontiel.persistentcookiejar.cache.SetCookieCache;
import com.franmontiel.persistentcookiejar.persistence.SharedPrefsCookiePersistor; import com.franmontiel.persistentcookiejar.persistence.SharedPrefsCookiePersistor;
@ -30,6 +32,7 @@ import gr.thmmy.mthmmy.BuildConfig;
import gr.thmmy.mthmmy.R; import gr.thmmy.mthmmy.R;
import gr.thmmy.mthmmy.session.SessionManager; import gr.thmmy.mthmmy.session.SessionManager;
import gr.thmmy.mthmmy.utils.CrashReportingTree; import gr.thmmy.mthmmy.utils.CrashReportingTree;
import io.fabric.sdk.android.Fabric;
import okhttp3.HttpUrl; import okhttp3.HttpUrl;
import okhttp3.Interceptor; import okhttp3.Interceptor;
import okhttp3.OkHttpClient; import okhttp3.OkHttpClient;
@ -59,6 +62,13 @@ public class BaseApplication extends Application {
super.onCreate(); super.onCreate();
baseApplication = this; //init singleton 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) { if (BuildConfig.DEBUG) {
Timber.plant(new Timber.DebugTree()); Timber.plant(new Timber.DebugTree());
} else { } else {

Loading…
Cancel
Save