致命的异常会在Firebase
仪表板中显示。但非致命的异常不会在Firebase crashlytics
和Firebase crash reporting
中显示。在非致命崩溃后,我多次重启了应用程序,但在Firebase仪表板
中仍然没有崩溃记录。
依赖项为:
implementation('com.crashlytics.sdk.android:crashlytics:2.9.1@aar') {
transitive = true
}
implementation 'com.google.firebase:firebase-core:11.8.0'
implementation 'com.google.firebase:firebase-messaging:11.8.0'
以下是处理非致命异常的代码。
try {
throw new IndexOutOfBoundsException("Fake IndexOutOfBoundsException");
} catch (Exception e) {
Crashlytics.logException(e);
}