Reputation: 650
I have a project that I have migrated over to firebase Crashlytics from Fabric. This all worked fine initially and I received crash reports into firebase as expected. In the last couple of months it has come to light that firebase is no longer displaying any crash reports, whilst fabric still is.
The app build process is currently using R8, but I have also tried using Proguard and R8 Full Mode to no avail.
I've checked the configuration of Proguard and have got what I believe is the correct rules in the proguard rules file:
-keep class com.crashlytics.** { *; }
-dontwarn com.crashlytics.**
-keepattributes *Annotation*
-keepattributes SourceFile,LineNumberTable
-keep public class * extends java.lang.Exception
If I run the app without signing / proguarding it, crashes are received as expected (Forcing crashes using Crashlytics.getInstance().crash()
).
Something else that is strange is that when forcing a crash on the proguarded builds using Crashlytics.getInstance().crash()
, instead of crashing and showing the standard android pop-up saying the app closed, the app freezes instead and sits there doing nothing at all unless I force close it.
After turning on the Firebase Crashlytics logging in adb
and looking at the logs (using the command adb logcat -s Fabric CrashlyticsCore
) for the proguarded builds I see only:
--------- beginning of main
--------- beginning of system
--------- beginning of crash
vs the following on the non-proguarded builds:
--------- beginning of main
--------- beginning of system
12-06 09:24:03.055 20894 20894 D Fabric : Build ID is: {REPLACED}
12-06 09:24:03.056 20894 20894 I CrashlyticsCore: Initializing Crashlytics Core 2.7.0.33
12-06 09:24:03.092 20894 20894 D CrashlyticsCore: Exception handling initialization successful
12-06 09:24:03.093 20894 20894 D Fabric : Initializing io.fabric.sdk.android:fabric [Version: 1.4.8.32], with the following kits:
12-06 09:24:03.093 20894 20894 D Fabric : com.crashlytics.sdk.android:crashlytics [Version: 2.10.1.34]
12-06 09:24:03.093 20894 20894 D Fabric : com.crashlytics.sdk.android:answers [Version: 1.4.7.32]
12-06 09:24:03.093 20894 20894 D Fabric : com.crashlytics.sdk.android:beta [Version: 1.2.10.27]
12-06 09:24:03.093 20894 20894 D Fabric : com.crashlytics.sdk.android.crashlytics-core [Version: 2.7.0.33]
12-06 09:24:03.093 20894 20894 D Fabric :
12-06 09:24:04.605 20894 21000 D Fabric : Using AdvertisingInfo from Reflection Provider
12-06 09:24:04.660 20894 20988 D Fabric : Build ID is: {REPLACED}
12-06 09:24:04.672 20894 21003 D CrashlyticsCore: Opening a new session with ID {REPLACED}
12-06 09:24:04.678 20894 21000 D Fabric : Build ID is: {REPLACED}
12-06 09:24:04.706 20894 20988 D Fabric : Build ID is: {REPLACED}
12-06 09:24:04.736 20894 20988 D Fabric : Requesting settings from https://settings.crashlytics.com/spi/v2/platforms/android/apps/{REPLACED}
12-06 09:24:04.741 20894 20988 D Fabric : Settings query params were: {instance=e6199970543402496ab15ac231f04e89dc42dea5, build_version=6128, display_version=6.3.0, source=1, icon_hash=7d8e21c0bbb767a8faeff7b75b8eb0db7aa90aa8}
12-06 09:24:05.476 20894 20988 D Fabric : Settings result was: 200
12-06 09:24:05.494 20894 20988 D Fabric : Settings request ID: null
12-06 09:24:05.502 20894 20988 D Fabric : Writing settings to cache file...
12-06 09:24:05.517 20894 20988 D Fabric : Loaded settings: {"settings_version":2,"cache_duration":86400,"features":{"collect_logged_exceptions":true,"collect_reports":true,"collect_analytics":true,"push_enabled":true,"firebase_crashlytics_enabled":true},"analytics":{"url":"https:\/\/e.crashlytics.com\/spi\/v2\/events","flush_interval_secs":120,"max_file_count_per_send":1,"track_custom_events":true,"track_predefined_events":true,"flush_on_background":true,"max_byte_size_per_file":40000,"max_pending_send_file_count":20,"sampling_rate":1,"forward_to_google_analytics":true},"beta":{"update_suspend_duration":1209600},"app":{"identifier":"com.hermes.induction.dev","status":"activated","url":"https:\/\/api.crashlytics.com\/spi\/v1\/platforms\/android\/apps\/{REPLACED}","reports_url":"https:\/\/reports.crashlytics.com\/spi\/v1\/platforms\/android\/apps\/{REPLACED}\/reports","ndk_reports_url":"https:\/\/reports.crashlytics.com\/sdk-api\/v1\/platforms\/android\/apps\/{REPLACED}\/minidumps","update_required":true},"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":1575710645499}
12-06 09:24:05.520 20894 20988 D Fabric : Build ID is: {REPLACED}
12-06 09:24:05.521 20894 20988 D Fabric : Server says an update is required - forcing a full App update.
12-06 09:24:05.522 20894 20988 D Fabric : App icon resource ID is 2131230980
12-06 09:24:05.527 20894 20988 D Fabric : Build ID is: {REPLACED}
12-06 09:24:06.149 20894 20988 D Fabric : Sending app info to https://api.crashlytics.com/spi/v1/platforms/android/apps/{REPLACED}
12-06 09:24:06.150 20894 20988 D Fabric : App icon hash is 7d8e21c0bbb767a8faeff7b75b8eb0db7aa90aa8
12-06 09:24:06.150 20894 20988 D Fabric : App icon size is 288x288
12-06 09:24:06.407 20894 20988 D Fabric : Update app request ID: d5c5155cd486e93aee14e51526dc7399
12-06 09:24:06.407 20894 20988 D Fabric : Result was 204
12-06 09:24:06.412 20894 21003 D CrashlyticsCore: Initialization marker file created.
12-06 09:24:06.422 20894 20988 D CrashlyticsCore: Registered Firebase Analytics event listener for breadcrumbs: true
12-06 09:24:06.423 20894 21003 D CrashlyticsCore: Finalizing previously open sessions.
12-06 09:24:06.436 20894 21003 D CrashlyticsCore: No open sessions to be closed.
12-06 09:24:06.436 20894 21003 D CrashlyticsCore: Closed all previously open sessions
12-06 09:24:06.441 20894 21247 D CrashlyticsCore: Starting report processing in 1.0 second(s)...
12-06 09:24:06.448 20894 21003 D CrashlyticsCore: Initialization marker file removed: true
12-06 09:24:07.441 20894 21247 D CrashlyticsCore: Checking for crash reports...
12-06 09:24:07.445 20894 21247 D CrashlyticsCore: No reports found.
I'm now at a loss of what else could be the issue, as nothing regarding proguard has been changed since the issues started. Does anyone know any other reasons that this may not be working and how to resolve them?
Upvotes: 3
Views: 1063
Reputation: 29
R8 generates a mapping.txt
file which helps to retrace the stack trace for each build. The file is located at following path:
app\build\outputs\mapping\{build-variant}\mapping.txt
If you upload your app using app bundles, the mapping file is included by default. Otherwise you can manually upload mapping.txt in playstore.
You should add these following rules to progaurd-rules.pro
to support retracing:
-keepattributes LineNumberTable,SourceFile
-renamesourcefileattribute SourceFile
For further details, refer to:
Upvotes: -1