Firebase Crashlytics not crash log statistics to a solution of
1, to determine the correct integration
Before trying any other method, make sure you have successfully integrated Crashlytics, you can console to determine whether the successful integration according to different styles.
2、UncaughtExceptionHandler
Check to see if your project has achieved its UncaughtExceptionHandler, if there is please remove.
View Crashlytics because the source code, CrashlyticsUncaughtExceptionHandler has achieved the UncaughtExceptionHandler, code is as follows:
class CrashlyticsUncaughtExceptionHandler implements UncaughtExceptionHandler{
...
}
Then CrashlyticsController class:
class CrashlyticsController {
...
void enableExceptionHandling(UncaughtExceptionHandler defaultHandler, boolean firebaseCrashlyticsClientFlag) {
this.openSession();
CrashListener crashListener = new CrashListener() {
public void onUncaughtException(SettingsDataProvider settingsDataProvider, Thread thread, Throwable ex, boolean firebaseCrashlyticsClientFlag) {
CrashlyticsController.this.handleUncaughtException(settingsDataProvider, thread, ex, firebaseCrashlyticsClientFlag);
}
};
this.crashHandler = new CrashlyticsUncaughtExceptionHandler(crashListener, new CrashlyticsController.DefaultSettingsDataProvider(), firebaseCrashlyticsClientFlag, defaultHandler);
Thread.setDefaultUncaughtExceptionHandler(this.crashHandler);
}
}
So when we use Thread.setDefaultUncaughtExceptionHandler (), and set up a custom processing class, Crashlytics would fail, of course, not to crash statistics information!