Crashlytics.logException 未在 android 上工作

Crashlytics.logException is not working on android

致命异常显示在 Firebase 仪表板中。但是 Firebase crashlyticsFirebase crash reporting 中没有显示非致命异常。我在非致命崩溃后多次重启应用程序,但 Firebase dashboard 中仍然没有崩溃。 依赖项是:-

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);
}

试试这个:-

Crashlytics.getInstance().core.logException(e);

由于某种原因,日期设置不正确。日期定在昨天。

To reduce your users' network traffic, Crashlytics batches logged exceptions together and sends them the next time the app launches. If you don't see logged exceptions in your Crashlytics web dashboard, try restarting your app!

来自: https://support.crashlytics.com/knowledgebase/articles/202805-logging-caught-exceptions