Issue
I started using Firebase (Crashlytics) in my project to track app crashes. It works perfectly with crashes but how can I log non-fatal crashes, i.e. caught exceptions. I tried Crashlytics.logException(e)
but it doesn't work. I see no reports in the dashboard. I saw answers suggesting to use FirebaseCrash.report(t)
but this class doesn't exist in the latest version of Firebase. So does anyone know how it's done?
Dependencies:
implementation 'com.google.firebase:firebase-core:16.0.0'
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.3'
Solution
With the new Firebase Crashlytics you should use recordException(@NonNull Throwable throwable)
...
catch (e: Exception) {
FirebaseCrashlytics.getInstance().recordException(e)
}
...
Here is firebase documentation stating that
Answered By - Akbolat SSS