'Crashlytics not appear crash in dashboard

I added Firebase Crashlytics in my project and I force created a crash with the below code. The crash was created and logged in logcat but didn't appear in Crashlytics dashboard!

I enabled debug logging to my project and I saw the below message when forcing a crash, but I don't know what this is / what the problem is?

I can see my errors in Fabric console but they don't show in Firebase. In Firebase, Analytics reports like users in last 30 minutes work with my application. I've been trying for around 3 days but still can't see the error in my dashboard!

My code:

  Button crashBtn=findViewById(R.id.crashBtn);
    crashBtn.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Crashlytics.getInstance().crash();
        }
    });

My error after enable debug logging with adb:

01-30 09:38:58.919 24986 24986 D CrashlyticsCore: Crashlytics is handling uncaught exception "java.lang.ArrayIndexOutOfBoundsException: length=2; index=10" from thread main
01-30 09:38:58.956 24986 25028 D CrashlyticsCore: No log data to include with this event.
01-30 09:38:59.121 24986 25028 D CrashlyticsCore: Closing open sessions.
01-30 09:38:59.121 24986 25028 D CrashlyticsCore: Closing session: 5C513E7B02FD-0001-619A-AF0E1194ACF2
01-30 09:38:59.121 24986 25028 D CrashlyticsCore: Collecting session parts for ID 5C513E7B02FD-0001-619A-AF0E1194ACF2
01-30 09:38:59.124 24986 25028 D CrashlyticsCore: Session 5C513E7B02FD- 
0001-619A-AF0E1194ACF2 has fatal exception: true
01-30 09:38:59.127 24986 25028 D CrashlyticsCore: Session 5C513E7B02FD-0001-619A-AF0E1194ACF2 has non-fatal exceptions: false
01-30 09:38:59.129 24986 25028 D CrashlyticsCore: Collecting SessionStart data for session ID 5C513E7B02FD-0001-619A-AF0E1194ACF2
01-30 09:38:59.133 24986 25028 D CrashlyticsCore: Collecting SessionUser data for session ID 5C513E7B02FD-0001-619A-AF0E1194ACF2
01-30 09:38:59.137 24986 25028 D CrashlyticsCore: Collecting SessionApp data for session ID 5C513E7B02FD-0001-619A-AF0E1194ACF2
01-30 09:38:59.139 24986 25028 D CrashlyticsCore: Collecting SessionOS data for session ID 5C513E7B02FD-0001-619A-AF0E1194ACF2
01-30 09:38:59.140 24986 25028 D CrashlyticsCore: Collecting SessionDevice data for session ID 5C513E7B02FD-0001-619A-AF0E1194ACF2
01-30 09:38:59.143 24986 25028 D CrashlyticsCore: Removing session part files for ID 5C513E7B02FD-0001-619A-AF0E1194ACF2
01-30 09:38:59.148 24986 25028 D CrashlyticsCore: Opening a new session with ID 5C513F7B0091-0002-619A-AF0E1194ACF2
01-30 09:38:59.172 24986 24986 D CrashlyticsCore: Crashlytics completed exception processing. Invoking default exception handler.
01-30 09:38:59.174 24986 25028 D CrashlyticsCore: Attempting to send crash report at time of crash...
01-30 09:39:00.938 25250 25250 I CrashlyticsCore: Initializing Crashlytics 2.6.7.30
01-30 09:39:00.946 25250 25250 D CrashlyticsCore: Installer package name is: null
01-30 09:39:00.966 25250 25289 D CrashlyticsCore: Found previous crash marker.
01-30 09:39:00.975 25250 25250 D CrashlyticsCore: Exception handling initialization successful
01-30 09:39:00.981 25250 25289 D CrashlyticsCore: Opening a new session with ID 5C513F7C03D0-0001-62A2-AF0E1194ACF2
01-30 09:39:03.065 25250 25289 D CrashlyticsCore: Initialization marker file created.
01-30 09:39:03.075 25250 25289 D CrashlyticsCore: Finalizing previously open sessions.
01-30 09:39:03.091 25250 25289 D CrashlyticsCore: Closing open sessions.
01-30 09:39:03.091 25250 25289 D CrashlyticsCore: Closing session: 5C513F7B0091-0002-619A-AF0E1194ACF2
01-30 09:39:03.092 25250 25289 D CrashlyticsCore: Collecting session parts for ID 5C513F7B0091-0002-619A-AF0E1194ACF2
01-30 09:39:03.094 25250 25289 D CrashlyticsCore: Session 5C513F7B0091-0002-619A-AF0E1194ACF2 has fatal exception: false
01-30 09:39:03.096 25250 25289 D CrashlyticsCore: Session 5C513F7B0091-0002-619A-AF0E1194ACF2 has non-fatal exceptions: false
01-30 09:39:03.097 25250 25289 D CrashlyticsCore: No events present for session ID 5C513F7B0091-0002-619A-AF0E1194ACF2
01-30 09:39:03.097 25250 25289 D CrashlyticsCore: Removing session part files for ID 5C513F7B0091-0002-619A-AF0E1194ACF2
01-30 09:39:03.101 25250 25289 D CrashlyticsCore: Closed all previously open sessions
01-30 09:39:03.108 25250 25301 D CrashlyticsCore: Starting report processing in 1.0 second(s)...
01-30 09:39:03.109 25250 25289 D CrashlyticsCore: Initialization marker file removed: true
01-30 09:39:04.111 25250 25301 D CrashlyticsCore: Checking for crash reports...
01-30 09:39:04.125 25250 25301 D CrashlyticsCore: Found crash report /data/user/0/com..KITIL/files/.Fabric/com.crashlytics.sdk.android.crashlytics-core/fatal-sessions/5C513E7B02FD-0001-619A-AF0E1194ACF2.cls
01-30 09:39:04.128 25250 25301 D CrashlyticsCore: Attempting to send 1 report(s)
01-30 09:39:05.091 25250 25301 D CrashlyticsCore: Adding single file 5C513E7B02FD-0001-619A-AF0E1194ACF2.cls to report 5C513E7B02FD-0001-619A-AF0E1194ACF2
01-30 09:39:05.100 25250 25301 D CrashlyticsCore: Sending report to: https://reports.crashlytics.com/spi/v1/platforms/android/apps/com..kitil/reports
01-30 09:39:05.610 25250 25301 D CrashlyticsCore: Create report request ID: null
01-30 09:39:05.611 25250 25301 D CrashlyticsCore: Result was: 202
01-30 09:39:05.613 25250 25301 I CrashlyticsCore: Crashlytics report upload complete: 5C513E7B02FD-0001-619A-AF0E1194ACF2
01-30 09:39:05.614 25250 25301 D CrashlyticsCore: Removing report at /data/user/0/com..KITIL/files/.Fabric/com.crashlytics.sdk.android.crashlytics-core/fatal-sessions/5C513E7B02FD-0001-619A-AF0E1194ACF2.cls
01-30 09:39:05.618 25250 25301 D CrashlyticsCore: Checking for crash reports...
01-30 09:39:05.627 25250 25301 D CrashlyticsCore: No reports found.

I tried again and got this error:

01-30 11:09:45.711   571   605 D Fabric  : Loaded cached settings: {"settings_version":2,"cache_duration":60,"features":{"collect_logged_exceptions":true,"collect_reports":true,"collect_analytics":false,"prompt_enabled":false,"push_enabled":true,"firebase_crashlytics_enabled":false},"analytics":{"url":"https:\/\/e.crashlytics.com\/spi\/v2\/events","flush_interval_secs":600,"max_file_count_per_send":1,"track_custom_events":true,"track_predefined_events":true,"track_view_controllers":false,"flush_on_background":true,"max_byte_size_per_file":8000,"max_pending_send_file_count":100,"sampling_rate":1,"forward_to_google_analytics":false,"include_purchase_events_in_forwarded_events":false},"beta":{"update_suspend_duration":1209600,"update_endpoint":""},"app":{"identifier":"com.kharazmico.KITIL","status":"activated","url":"https:\/\/api.crashlytics.com\/spi\/v1\/platforms\/android\/apps\/com.kharazmico.kitil","reports_url":"https:\/\/reports.crashlytics.com\/spi\/v1\/platforms\/android\/apps\/com.kharazmico.kitil\/reports","ndk_reports_url":"https:\/\/reports.crashlytics.com\/sdk-api\/v1\/platforms\/android\/apps\/com.kharazmico.kitil\/minidumps","update_required":false},"session":{"log_buffer_size":64000,"max_chained_exception_depth":16,"max_complete_sessions_count":4,"max_custom_exception_events":8,"max_custom_key_value_pairs":64,"identifier_mask":255},"prompt":{"title":"Send Crash Report?","message":"Looks like we crashed! Please help us fix the problem by sending a crash report.","send_button_title":"Send","show_cancel_button":true,"cancel_button_title":"Don't Send","show_always_send_button":true,"always_send_button_title":"Always Send"},"expires_at":1548833904681}
01-30 11:09:45.711   571   605 D Fabric  : Cached settings have expired.
01-30 11:09:45.750   571   605 D Fabric  : Requesting settings from https://settings.crashlytics.com/spi/v2/platforms/android/apps/com..KITIL/settings
01-30 11:09:45.752   571   605 D Fabric  : Settings query params were: {instance=cb01562e3a7a8f402cebabbfddc9385b057fa76d, build_version=104, display_version=1.0.4, source=1, icon_hash=9c4d5c584a29e3b915652a0c7506ec23791535d7}
01-30 11:09:45.835   571   617 D Fabric  : Using AdvertisingInfo from Reflection Provider
01-30 11:09:47.108   571   605 D Fabric  : Settings result was: 200
01-30 11:09:47.119   571   605 D Fabric  : Settings request ID: ee5f21c7815d9a2cc78fbea383b1a313
01-30 11:09:47.121   571   605 D Fabric  : Writing settings to cache file...
01-30 11:09:47.135   571   605 D Fabric  : Loaded settings: {"settings_version":2,"cache_duration":60,"features":{"collect_logged_exceptions":true,"collect_reports":true,"collect_analytics":false,"prompt_enabled":false,"push_enabled":true,"firebase_crashlytics_enabled":false},"analytics":{"url":"https:\/\/e.crashlytics.com\/spi\/v2\/events","flush_interval_secs":600,"max_file_count_per_send":1,"track_custom_events":true,"track_predefined_events":true,"track_view_controllers":false,"flush_on_background":true,"max_byte_size_per_file":8000,"max_pending_send_file_count":100,"sampling_rate":1,"forward_to_google_analytics":false,"include_purchase_events_in_forwarded_events":false},"beta":{"update_suspend_duration":1209600,"update_endpoint":""},"app":{"identifier":"com..KITIL","status":"activated","url":"https:\/\/api.crashlytics.com\/spi\/v1\/platforms\/android\/apps\/com..kitil","reports_url":"https:\/\/reports.crashlytics.com\/spi\/v1\/platforms\/android\/apps\/com..kitil\/reports","ndk_reports_url":"https:\/\/reports.crashlytics.com\/sdk-api\/v1\/platforms\/android\/apps\/com..kitil\/minidumps","update_required":false},"session":{"log_buffer_size":64000,"max_chained_exception_depth":16,"max_complete_sessions_count":4,"max_custom_exception_events":8,"max_custom_key_value_pairs":64,"identifier_mask":255},"prompt":{"title":"Send Crash Report?","message":"Looks like we crashed! Please help us fix the problem by sending a crash report.","send_button_title":"Send","show_cancel_button":true,"cancel_button_title":"Don't Send","show_always_send_button":true,"always_send_button_title":"Always Send"},"expires_at":1548834047120}
01-30 11:09:47.136   571   605 D Fabric  : Build ID is: 17930dcb-1328-49b7-a31b-dab343f6e4d4
01-30 11:09:47.143   571   611 D Fabric  : Could not find method: isDataCollectionDefaultEnabled []
01-30 11:09:47.144   571   620 D CrashlyticsCore: Initialization marker file created.
01-30 11:09:47.153   571   610 D Fabric  : Could not find method: isDataCollectionDefaultEnabled []
01-30 11:09:47.154   571   620 D CrashlyticsCore: Finalizing previously open sessions.
01-30 11:09:47.170   571   620 D CrashlyticsCore: Closing open sessions.
01-30 11:09:47.170   571   620 D CrashlyticsCore: Closing session: 5C5154BF0366-0002-7F34-AF0E1194ACF2
01-30 11:09:47.170   571   620 D CrashlyticsCore: Collecting session parts for ID 5C5154BF0366-0002-7F34-AF0E1194ACF2
01-30 11:09:47.173   571   620 D CrashlyticsCore: Session 5C5154BF0366-0002-7F34-AF0E1194ACF2 has fatal exception: false
01-30 11:09:47.175   571   620 D CrashlyticsCore: Session 5C5154BF0366-0002-7F34-AF0E1194ACF2 has non-fatal exceptions: false
01-30 11:09:47.175   571   620 D CrashlyticsCore: No events present for session ID 5C5154BF0366-0002-7F34-AF0E1194ACF2
01-30 11:09:47.175   571   620 D CrashlyticsCore: Removing session part files for ID 5C5154BF0366-0002-7F34-AF0E1194ACF2
01-30 11:09:47.180   571   620 D CrashlyticsCore: Closed all previously open sessions
01-30 11:09:47.189   571   635 D CrashlyticsCore: Starting report processing in 1.0 second(s)...
01-30 11:09:47.189   571   620 D CrashlyticsCore: Initialization marker file removed: true
01-30 11:09:48.200   571   635 D CrashlyticsCore: Checking for crash reports...
01-30 11:09:48.213   571   635 D CrashlyticsCore: Found crash report /data/user/0/com..KITIL/files/.Fabric/com.crashlytics.sdk.android.crashlytics-core/fatal-sessions/5C5154330130-0001-7F34-AF0E1194ACF2.cls
01-30 11:09:48.216   571   635 D CrashlyticsCore: Attempting to send 1 report(s)
01-30 11:09:49.160   571   635 D CrashlyticsCore: Adding single file 5C5154330130-0001-7F34-AF0E1194ACF2.cls to report 5C5154330130-0001-7F34-AF0E1194ACF2
01-30 11:09:49.169   571   635 D CrashlyticsCore: Sending report to: https://reports.crashlytics.com/spi/v1/platforms/android/apps/com..kitil/reports
01-30 11:09:49.630   571   635 D CrashlyticsCore: Create report request ID: null
01-30 11:09:49.630   571   635 D CrashlyticsCore: Result was: 202
01-30 11:09:49.632   571   635 I CrashlyticsCore: Crashlytics report upload complete: 5C5154330130-0001-7F34-AF0E1194ACF2
01-30 11:09:49.634   571   635 D CrashlyticsCore: Removing report at /data/user/0/com..KITIL/files/.Fabric/com.crashlytics.sdk.android.crashlytics-core/fatal-sessions/5C5154330130-0001-7F34-AF0E1194ACF2.cls
01-30 11:09:49.636   571   635 D CrashlyticsCore: Checking for crash reports...
01-30 11:09:49.648   571   635 D CrashlyticsCore: No reports found.


Solution 1:[1]

Assumption: this happens only to those who migrate from Fabric.

Solution

For those who just do not see any crashes in Crashlytics tab in Firebase Console try manually enabling Crashlytics in your application before initializing FirebaseApp context.

FirebaseApp.initializeApp(this)
FirebaseCrashlytics.getInstance().setCrashlyticsCollectionEnabled(true)
// Optional. Uncomment if you are using analytics. 
// FirebaseAnalytics.getInstance(this).setAnalyticsCollectionEnabled(true)

After rebuilding and installing the application from the Android Studio to the physical device, and generating one more crash, I successfully got a crash report to appear in Firebase Console. Previous reports did not appear (in some part that is to be expected since there were no reports made).

What has triggered me to do this?

I was migrating from Fabric to Firebase, as many do now due to Fabric being deprecated and turned off on 15 November 2020. I enabled logs using adb shell setprop log.tag.FirebaseCrashlytics DEBUG. This is part of testing your implementation. Due to having issues with crash reporting, I enabled that feature to take a look if there is anything useful in these logs.

What I have noticed is that FirebaseCrashlytics loads cached settings if there are any. Reading through them I found an interesting key-value pair that could probably be the issue:

"firebase_crashlytics_enabled":false

This setting was weird. There is one more related to Firebase Analytics: "collect_analytics":false.

Both of them are false for some reason though I never did turn them off explicitly. Never even played with these settings. Only migrated from Fabric to Firebase.

09-25 11:08:50.045 30646 30646 D FirebaseCrashlytics: Loaded cached settings: {"settings_version":3,"cache_duration":86400,
"features":{"collect_logged_exceptions":true,"collect_reports":true,"collect_analytics":false,"prompt_enabled":false,"push_enabled":false,"firebase_crashlytics_enabled":false},
"app":{"status":"activated","update_required":false,"report_upload_variant":2,"native_report_upload_variant":2},
"fabric":{"org_id":"FabricApiKeyWasHere","bundle_id":"your.app.package.name"},
"expires_at":1601028354301}

Enabling Crashlytics, as described at the beginning of this post, I was able to turn crash reporting on and get reports to appear in Firebase Console. Note, that cached settings still have "firebase_crashlytics_enabled":false. Even after multiple reinstalls/reruns of the application.

Solution 2:[2]

This happened to me because I had this in the manifest:

        <meta-data
            android:name="firebase_crashlytics_collection_enabled"
            android:value="false" />

Solution 3:[3]

I started receiving logs when I updated gradle version on gradle-wrapper.properties from gradle-5.4.1-all.zip to gradle-6.1.1-all.zip

I still see in the logs:

FirebaseCrashlytics: Loaded cached settings: { ... "firebase_crashlytics_enabled":false ... }

and:

FirebaseCrashlytics: Send to Reports Endpoint disabled. Removing Reports Endpoint report.

But anyway the reports are being sent. Although sometimes it takes a longer time to send it, so I recommend to reopen and keep open your application for several minutes after crash.

Some other are having the same problem on this github thread on firebase sdk

Solution 4:[4]

In project level build.gradle file, add

classpath 'com.google.gms:google-services:4.3.10'

in app level build.gradle file, add this line at the bottom

apply plugin: 'com.google.gms.google-services'

and then try force crash the app

Solution 5:[5]

For me I have removed this function Thread.setDefaultUncaughtExceptionHandler() and Firebase Crashlytics worked well.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Jenea Vranceanu
Solution 2 Daniel Gomez Rico
Solution 3
Solution 4 minato
Solution 5 Islam Ahmed