Using the following setup, calling methods like Crashlytics.logException
would not crash during debug.
Edit AndroidManifest.xml
<manifest ...>
<application ...>
<meta-data
android:name="firebase_crashlytics_collection_enabled"
android:value="false" />
</application>
</manifest>
Edit module:app build.gradle
.
android {
...
buildTypes {
debug {
ext.enableCrashlytics = false
ext.alwaysUpdateBuildId = false
}
release {
ext.enableCrashlytics = true
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
Edit Application
class LuaApp : Application() { override fun onCreate() { super.onCreate() val crashlytics = Crashlytics.Builder() .core(CrashlyticsCore.Builder().disabled(BuildConfig.DEBUG).build()) .build() Fabric.with(this, crashlytics) }}