Is there any simple way to turn Crashlytics Android SDK off while developing ?
I don\'t want it to send a crash every time I do something stupid
On the othe
2019 Answer
I've been trying to only enable Crashlytics in release and disable in debug for 2 hours, checking the Firebase console to see if the Exceptions where uploaded or not.
There are 2 possible ways to do this.
It works, but if you call any Crashlytics method on debug builds the app will crash.
app/build.gradle
android {
buildTypes {
release {
manifestPlaceholders = [crashlyticsEnabled: true]
}
debug {
manifestPlaceholders = [crashlyticsEnabled: false]
}
AndroidManifest.xml
An alternative if that allows you to call Crashlytics methods without checking BuildConfig.DEBUG first. With this setup you can safely call methods like Crashlytics.logException() - they simply do nothing in debug builds. I don't see the reports being uploaded in debug.
app/build.gradle
android {
buildTypes {
release {
ext.enableCrashlytics = true
}
debug {
ext.enableCrashlytics = false
}
AndroidManifest.xml
Application onCreate()
val crashlytics = Crashlytics.Builder()
.core(CrashlyticsCore.Builder().disabled(BuildConfig.DEBUG).build())
.build()
Fabric.with(this, crashlytics)