Browse Source

Merge pull request #46 from ThmmyNoLife/crashlytics_fix

crashlytics issue fix
pull/50/head
oogee 6 years ago
committed by GitHub
parent
commit
b9d71e1a6f
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  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 {
def date = new Date().format('ddMMyy_HHmmss')
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

@ -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

Loading…
Cancel
Save