Firebase Crashlytics not uploading crashes for release apk

1.6k views Asked by At

I migrated to Firebase Crashlytics SDK. The debug app work's fine, the Crashlytics gets initialized and when there is a crash, after restarting the app it uploads the crashes to https://crashlyticsreports-pa.googleapis.com.

But when I create a release apk, the Crashlytics does get initialized but the logs do not get uploaded.

I am using com.google.firebase:firebase-crashlytics-gradle:2.3.0

Some logs after debugging:

10-14 17:47:42.803 10335 10723 D FirebaseCrashlytics: Executing shutdown hook for Crashlytics Exception Handler
10-14 17:47:42.804 10335 10724 D FirebaseCrashlytics: Executing shutdown hook for com.google.firebase.crashlytics.startup
10-14 17:47:42.808 10335 10725 D FirebaseCrashlytics: Executing shutdown hook for awaitEvenIfOnMainThread task continuation executor
10-14 17:47:50.523 10755 10755 D FirebaseCrashlytics: Crashlytics automatic data collection ENABLED by API.
10-14 17:47:50.523 10755 10755 D FirebaseCrashlytics: Firebase Analytics is available.
10-14 17:47:50.523 10755 10755 D FirebaseCrashlytics: Firebase Analytics listener registered successfully.
10-14 17:47:50.534 10755 10755 D FirebaseCrashlytics: Reading cached settings...
10-14 17:47:50.536 10755 10755 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":"593f7256d634338f7a00010e","bundle_id":"com.myapp"},"expires_at":1602742343631}
10-14 17:47:50.536 10755 10755 D FirebaseCrashlytics: Returning cached settings.
10-14 17:47:50.537 10755 10755 D FirebaseCrashlytics: Mapping file ID is: 3f921f2e662f4b19a04a74d134464115d
10-14 17:47:50.537 10755 10755 I FirebaseCrashlytics: Initializing Crashlytics 17.2.2
10-14 17:47:50.538 10755 10755 D FirebaseCrashlytics: Installer package name is: null
10-14 17:47:50.564 10755 10755 D FirebaseCrashlytics: Exception handling initialization successful
10-14 17:47:50.607 10755 10782 D FirebaseCrashlytics: Found matching FID, using Crashlytics IID: 9b68e8c3d603455d8296cfe9e85d2de7
10-14 17:47:50.607 10755 10782 D FirebaseCrashlytics: Opening a new session with ID 5F869F160238-0001-2A03-9234AE8E16EA
10-14 17:47:50.621 10755 10782 D FirebaseCrashlytics: Initialization marker file created.
10-14 17:47:50.622 10755 10782 D FirebaseCrashlytics: Registered Firebase Analytics event receiver for breadcrumbs
10-14 17:47:50.622 10755 10782 D FirebaseCrashlytics: Finalizing previously open sessions.
10-14 17:47:50.625 10755 10782 D FirebaseCrashlytics: Closing open sessions.
10-14 17:47:50.625 10755 10782 D FirebaseCrashlytics: Closing session: 5F8697A600BB-0001-285F-9234AE8E16EA
10-14 17:47:50.625 10755 10782 D FirebaseCrashlytics: Collecting session parts for ID 5F8697A600BB-0001-285F-9234AE8E16EA
10-14 17:47:50.625 10755 10782 D FirebaseCrashlytics: Session 5F8697A600BB-0001-285F-9234AE8E16EA has fatal exception: false
10-14 17:47:50.625 10755 10782 D FirebaseCrashlytics: Session 5F8697A600BB-0001-285F-9234AE8E16EA has non-fatal exceptions: false
10-14 17:47:50.625 10755 10782 D FirebaseCrashlytics: No events present for session ID 5F8697A600BB-0001-285F-9234AE8E16EA
10-14 17:47:50.625 10755 10782 D FirebaseCrashlytics: Removing session part files for ID 5F8697A600BB-0001-285F-9234AE8E16EA
10-14 17:47:50.629 10755 10782 D FirebaseCrashlytics: Finalizing report for session 5F8697A600BB0001285F9234AE8E16EA
10-14 17:47:50.630 10755 10782 D FirebaseCrashlytics: Session 5F8697A600BB0001285F9234AE8E16EA has no events.
10-14 17:47:50.631 10755 10782 D FirebaseCrashlytics: Closed all previously open sessions
10-14 17:47:50.631 10755 10782 D FirebaseCrashlytics: No reports are available.
10-14 17:47:50.631 10755 10782 D FirebaseCrashlytics: Initialization marker file removed: true
10-14 17:47:50.688 10755 10755 D FirebaseCrashlytics: Crashlytics automatic data collection ENABLED by API.

When I did run the debug app with logs enabled I saw the crash that I invoked. Which I did not see when I ran the release apk.

10-14 18:04:14.162 11202 11202 D FirebaseCrashlytics: Crashlytics is handling uncaught exception "java.lang.RuntimeException: Testing....." from thread main

*** After lot of debugging I found out that if I have: ***

Thread.setDefaultUncaughtExceptionHandler(new CrashHandler());

Then Crashes are not getting reported to Firebase. The same worked with Fabric though. Any idea how I should handle it?

1

There are 1 answers

0
dipesh sangani On

Please remove the setDefaultUncaughtExceptionHandler from the code. going forward crashlytics will take care of handling crashes default.