firebase / flutterfire

🔥 A collection of Firebase plugins for Flutter apps.
https://firebase.google.com/docs/flutter/setup
BSD 3-Clause "New" or "Revised" License
8.73k stars 3.98k forks source link

🐛 [firebase_messaging] Crashes after updating to 14.7.10 #12207

Closed pafciu17 closed 4 months ago

pafciu17 commented 10 months ago

Bug report

Describe the bug After the update to 14.7.10 we started to see new crashes in Crashlytics (production environment).

Fatal Exception: android.os.BadParcelableException: Parcelable protocol requires subclassing from Parcelable on class com.google.firebase.messaging.o0
       at android.os.Parcel.readParcelableCreatorInternal(Parcel.java:4993)
       at android.os.Parcel.readParcelableInternal(Parcel.java:4873)
       at android.os.Parcel.readValue(Parcel.java:4633)
       at android.os.Parcel.readValue(Parcel.java:4402)
       at android.os.Parcel.-$$Nest$mreadValue()
       at android.os.Parcel$LazyValue.apply(Parcel.java:4500)
       at android.os.Parcel$LazyValue.apply(Parcel.java:4459)
       at android.os.BaseBundle.unwrapLazyValueFromMapLocked(BaseBundle.java:415)
       at android.os.BaseBundle.getValueAt(BaseBundle.java:401)
       at android.os.BaseBundle.getValue(BaseBundle.java:381)
       at android.os.BaseBundle.getValue(BaseBundle.java:364)
       at android.os.BaseBundle.getValue(BaseBundle.java:357)
       at android.os.Bundle.getParcelable(Bundle.java:913)
       at android.content.Intent.getParcelableExtra(Intent.java:9769)
       at io.flutter.plugins.firebase.messaging.FlutterFirebaseMessagingBackgroundExecutor.executeDartCallbackInBackgroundIsolate(FlutterFirebaseMessagingBackgroundExecutor.java:247)
       at io.flutter.plugins.firebase.messaging.FlutterFirebaseMessagingBackgroundService.lambda$onHandleWork$0(FlutterFirebaseMessagingBackgroundService.java:149)
       at android.os.Handler.handleCallback(Handler.java:958)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loopOnce(Looper.java:230)
       at android.os.Looper.loop(Looper.java:319)
       at android.app.ActivityThread.main(ActivityThread.java:8893)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:608)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)

Steps to reproduce

Steps to reproduce the behavior:

  1. Upgrade firebase_messaging package version to 14.7.10

Expected behavior

No crashes

Flutter doctor

Run flutter doctor and paste the output below:

Click To Expand ``` [✓] Flutter (Channel stable, 3.16.8, on macOS 14.2.1 23C71 darwin-x64, locale en-FI) [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2) [✓] Xcode - develop for iOS and macOS (Xcode 15.2) [✓] Chrome - develop for the web [✓] Android Studio (version 2022.2) [✓] VS Code (version 1.85.2) [✓] Connected device (3 available) [✓] Network resources ```

Flutter dependencies

Run flutter pub deps -- --style=compact and paste the output below:

Click To Expand ``` Dart SDK 3.2.5 Flutter SDK 3.16.8 dependencies: - advertising_id 2.6.0 [flutter] - appsflyer_sdk 6.12.2 [flutter] - cached_network_image 3.3.1 [cached_network_image_platform_interface cached_network_image_web flutter flutter_cache_manager octo_image] - camera 0.10.5+9 [camera_android camera_avfoundation camera_platform_interface camera_web flutter flutter_plugin_android_lifecycle] - cloud_firestore 4.14.0 [cloud_firestore_platform_interface cloud_firestore_web collection firebase_core firebase_core_platform_interface flutter meta] - cloud_functions 4.6.0 [cloud_functions_platform_interface cloud_functions_web firebase_core firebase_core_platform_interface flutter] - collection 1.18.0 - connectivity_plus 5.0.2 [flutter flutter_web_plugins connectivity_plus_platform_interface js meta nm] - cupertino_icons 1.0.6 - device_apps 2.2.0 [flutter] - device_info_plus 9.1.1 [device_info_plus_platform_interface ffi file flutter flutter_web_plugins meta win32 win32_registry] - facebook_app_events 0.19.0 [flutter] - file_picker 6.1.1 [flutter flutter_web_plugins flutter_plugin_android_lifecycle plugin_platform_interface ffi path win32] - firebase_analytics 10.8.0 [firebase_analytics_platform_interface firebase_analytics_web firebase_core firebase_core_platform_interface flutter] - firebase_auth 4.16.0 [firebase_auth_platform_interface firebase_auth_web firebase_core firebase_core_platform_interface flutter meta] - firebase_crashlytics 3.4.9 [firebase_core firebase_core_platform_interface firebase_crashlytics_platform_interface flutter stack_trace] - firebase_dynamic_links 5.4.8 [firebase_core firebase_core_platform_interface firebase_dynamic_links_platform_interface flutter meta plugin_platform_interface] - firebase_in_app_messaging 0.7.4+8 [firebase_core firebase_core_platform_interface firebase_in_app_messaging_platform_interface flutter meta] - firebase_messaging 14.7.10 [firebase_core firebase_core_platform_interface firebase_messaging_platform_interface firebase_messaging_web flutter meta] - firebase_remote_config 4.3.8 [firebase_core firebase_core_platform_interface firebase_remote_config_platform_interface firebase_remote_config_web flutter] - firebase_storage 11.6.0 [firebase_core firebase_core_platform_interface firebase_storage_platform_interface firebase_storage_web flutter] - fl_chart 0.66.1 [equatable flutter] - flare_flutter 3.0.2 [collection flutter meta] - flutter 0.0.0 [characters collection material_color_utilities meta vector_math web sky_engine] - flutter_facebook_auth 6.0.4 [flutter flutter_facebook_auth_platform_interface flutter_facebook_auth_web] - flutter_image_compress 2.1.0 [flutter flutter_image_compress_platform_interface flutter_image_compress_common flutter_image_compress_web flutter_image_compress_macos] - flutter_inappwebview 6.0.0 [flutter flutter_inappwebview_platform_interface flutter_inappwebview_android flutter_inappwebview_ios flutter_inappwebview_macos flutter_inappwebview_web] - flutter_keyboard_visibility 6.0.0 [meta flutter_keyboard_visibility_platform_interface flutter_keyboard_visibility_linux flutter_keyboard_visibility_macos flutter_keyboard_visibility_web flutter_keyboard_visibility_windows flutter] - flutter_localizations 0.0.0 [flutter intl characters clock collection material_color_utilities meta path vector_math web] - flutter_smartlook 4.1.15 [flutter] - flutter_speed_dial 7.0.0 [flutter] - flutter_svg 2.0.9 [flutter vector_graphics vector_graphics_codec vector_graphics_compiler] - flutter_video_info 1.3.1 [flutter path] - google_sign_in 6.2.1 [flutter google_sign_in_android google_sign_in_ios google_sign_in_platform_interface google_sign_in_web] - http 1.2.0 [async http_parser meta web] - image 4.1.4 [archive meta xml] - image_picker 1.0.7 [flutter image_picker_android image_picker_for_web image_picker_ios image_picker_linux image_picker_macos image_picker_platform_interface image_picker_windows] - in_app_review 2.0.8 [flutter in_app_review_platform_interface] - in_app_update 4.2.2 [flutter] - intl 0.18.1 [clock meta path] - light_compressor 2.2.0 [flutter] - mime 1.0.5 - package_info_plus 5.0.1 [ffi flutter flutter_web_plugins http meta path package_info_plus_platform_interface web win32] - path_provider 2.1.2 [flutter path_provider_android path_provider_foundation path_provider_linux path_provider_platform_interface path_provider_windows] - permission_handler 11.2.0 [flutter meta permission_handler_android permission_handler_apple permission_handler_html permission_handler_windows permission_handler_platform_interface] - photo_manager 3.0.0-dev.5 [flutter] - photo_view 0.14.0 [flutter] - provider 6.1.1 [collection flutter nested] - purchases_flutter 6.17.0 [flutter freezed_annotation json_annotation] - rxdart 0.27.7 - share_plus 7.2.1 [cross_file meta mime flutter flutter_web_plugins share_plus_platform_interface file url_launcher_web url_launcher_windows url_launcher_linux url_launcher_platform_interface ffi win32] - shared_preferences 2.2.2 [flutter shared_preferences_android shared_preferences_foundation shared_preferences_linux shared_preferences_platform_interface shared_preferences_web shared_preferences_windows] - sign_in_with_apple 5.0.0 [flutter meta sign_in_with_apple_platform_interface sign_in_with_apple_web] - table_calendar 3.0.9 [flutter intl simple_gesture_detector] - unsplash_client 2.2.0 [meta http collection logging] - url_launcher 6.2.4 [flutter url_launcher_android url_launcher_ios url_launcher_linux url_launcher_macos url_launcher_platform_interface url_launcher_web url_launcher_windows] - uuid 4.3.3 [crypto sprintf meta fixnum] - version 3.0.2 - video_player 2.8.2 [flutter html video_player_android video_player_avfoundation video_player_platform_interface video_player_web] - video_thumbnail 0.5.3 [flutter] dev dependencies: - flutter_launcher_icons 0.13.1 [args checked_yaml cli_util image json_annotation path yaml] - flutter_test 0.0.0 [flutter test_api matcher path fake_async clock stack_trace vector_math async boolean_selector characters collection material_color_utilities meta source_span stream_channel string_scanner term_glyph web] dependency overrides: - photo_manager 3.0.0-dev.5 [flutter] transitive dependencies: - _flutterfire_internals 1.3.16 [collection firebase_core firebase_core_platform_interface flutter meta] - archive 3.4.10 [crypto path pointycastle] - args 2.4.2 - async 2.11.0 [collection meta] - boolean_selector 2.1.1 [source_span string_scanner] - cached_network_image_platform_interface 4.0.0 [flutter flutter_cache_manager] - cached_network_image_web 1.1.1 [cached_network_image_platform_interface flutter flutter_cache_manager] - camera_android 0.10.8+16 [camera_platform_interface flutter flutter_plugin_android_lifecycle stream_transform] - camera_avfoundation 0.9.14 [camera_platform_interface flutter stream_transform] - camera_platform_interface 2.7.2 [cross_file flutter plugin_platform_interface stream_transform] - camera_web 0.3.2+4 [camera_platform_interface flutter flutter_web_plugins stream_transform] - characters 1.3.0 - checked_yaml 2.0.3 [json_annotation source_span yaml] - cli_util 0.4.1 [meta path] - clock 1.1.1 - cloud_firestore_platform_interface 6.1.0 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface] - cloud_firestore_web 3.9.0 [_flutterfire_internals cloud_firestore_platform_interface collection firebase_core firebase_core_web flutter flutter_web_plugins js] - cloud_functions_platform_interface 5.5.11 [firebase_core flutter meta plugin_platform_interface] - cloud_functions_web 4.6.11 [cloud_functions_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins js] - connectivity_plus_platform_interface 1.2.4 [flutter meta plugin_platform_interface] - convert 3.1.1 [typed_data] - cross_file 0.3.3+8 [meta web] - crypto 3.0.3 [typed_data] - csslib 1.0.0 [source_span] - dbus 0.7.10 [args ffi meta xml] - device_info_plus_platform_interface 7.0.0 [flutter meta plugin_platform_interface] - equatable 2.0.5 [collection meta] - fake_async 1.3.1 [clock collection] - ffi 2.1.0 - file 7.0.0 [meta path] - file_selector_linux 0.9.2+1 [cross_file file_selector_platform_interface flutter] - file_selector_macos 0.9.3+3 [cross_file file_selector_platform_interface flutter] - file_selector_platform_interface 2.6.2 [cross_file flutter http plugin_platform_interface] - file_selector_windows 0.9.3+1 [cross_file file_selector_platform_interface flutter] - firebase_analytics_platform_interface 3.9.0 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface] - firebase_analytics_web 0.5.5+12 [_flutterfire_internals firebase_analytics_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins js] - firebase_auth_platform_interface 7.0.9 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface] - firebase_auth_web 5.8.13 [firebase_auth_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins http_parser js meta] - firebase_core 2.24.2 [firebase_core_platform_interface firebase_core_web flutter meta] - firebase_core_platform_interface 5.0.0 [collection flutter flutter_test meta plugin_platform_interface] - firebase_core_web 2.10.0 [firebase_core_platform_interface flutter flutter_web_plugins js meta] - firebase_crashlytics_platform_interface 3.6.16 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface] - firebase_dynamic_links_platform_interface 0.2.6+16 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface] - firebase_in_app_messaging_platform_interface 0.2.4+16 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface] - firebase_messaging_platform_interface 4.5.18 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface] - firebase_messaging_web 3.5.18 [_flutterfire_internals firebase_core firebase_core_web firebase_messaging_platform_interface flutter flutter_web_plugins js meta] - firebase_remote_config_platform_interface 1.4.16 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface] - firebase_remote_config_web 1.4.16 [firebase_core firebase_core_web firebase_remote_config_platform_interface flutter flutter_web_plugins js] - firebase_storage_platform_interface 5.1.3 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface] - firebase_storage_web 3.6.17 [_flutterfire_internals async firebase_core firebase_core_web firebase_storage_platform_interface flutter flutter_web_plugins http js meta] - fixnum 1.1.0 - flutter_cache_manager 3.3.1 [clock collection file flutter http path path_provider rxdart sqflite uuid] - flutter_facebook_auth_platform_interface 5.0.0 [flutter plugin_platform_interface] - flutter_facebook_auth_web 5.0.0 [flutter flutter_web_plugins js flutter_facebook_auth_platform_interface] - flutter_image_compress_common 1.0.3 [flutter flutter_image_compress_platform_interface] - flutter_image_compress_macos 1.0.1 [flutter flutter_image_compress_platform_interface] - flutter_image_compress_platform_interface 1.0.3 [flutter plugin_platform_interface cross_file] - flutter_image_compress_web 0.1.3+2 [flutter flutter_web_plugins flutter_image_compress_platform_interface js] - flutter_inappwebview_android 1.0.12 [flutter flutter_inappwebview_platform_interface] - flutter_inappwebview_internal_annotations 1.1.1 - flutter_inappwebview_ios 1.0.13 [flutter flutter_inappwebview_platform_interface] - flutter_inappwebview_macos 1.0.11 [flutter flutter_inappwebview_platform_interface] - flutter_inappwebview_platform_interface 1.0.10 [flutter flutter_inappwebview_internal_annotations plugin_platform_interface] - flutter_inappwebview_web 1.0.8 [flutter flutter_web_plugins js flutter_inappwebview_platform_interface] - flutter_keyboard_visibility_linux 1.0.0 [flutter_keyboard_visibility_platform_interface flutter] - flutter_keyboard_visibility_macos 1.0.0 [flutter_keyboard_visibility_platform_interface flutter] - flutter_keyboard_visibility_platform_interface 2.0.0 [flutter meta plugin_platform_interface] - flutter_keyboard_visibility_web 2.0.0 [flutter_keyboard_visibility_platform_interface flutter_web_plugins flutter] - flutter_keyboard_visibility_windows 1.0.0 [flutter_keyboard_visibility_platform_interface flutter] - flutter_plugin_android_lifecycle 2.0.17 [flutter] - flutter_web_plugins 0.0.0 [flutter characters collection material_color_utilities meta vector_math web] - freezed_annotation 2.4.1 [collection json_annotation meta] - google_identity_services_web 0.3.0+2 [meta web] - google_sign_in_android 6.1.21 [flutter google_sign_in_platform_interface] - google_sign_in_ios 5.7.3 [flutter google_sign_in_platform_interface] - google_sign_in_platform_interface 2.4.5 [flutter plugin_platform_interface] - google_sign_in_web 0.12.3+2 [flutter flutter_web_plugins google_identity_services_web google_sign_in_platform_interface http web] - html 0.15.4 [csslib source_span] - http_parser 4.0.2 [collection source_span string_scanner typed_data] - image_picker_android 0.8.9+3 [flutter flutter_plugin_android_lifecycle image_picker_platform_interface] - image_picker_for_web 3.0.2 [flutter flutter_web_plugins image_picker_platform_interface mime] - image_picker_ios 0.8.9+1 [flutter image_picker_platform_interface] - image_picker_linux 0.2.1+1 [file_selector_linux file_selector_platform_interface flutter image_picker_platform_interface] - image_picker_macos 0.2.1+1 [file_selector_macos file_selector_platform_interface flutter image_picker_platform_interface] - image_picker_platform_interface 2.9.3 [cross_file flutter http plugin_platform_interface] - image_picker_windows 0.2.1+1 [file_selector_platform_interface file_selector_windows flutter image_picker_platform_interface] - in_app_review_platform_interface 2.0.5 [flutter url_launcher plugin_platform_interface platform] - js 0.6.7 [meta] - json_annotation 4.8.1 [meta] - logging 1.2.0 - matcher 0.12.16 [async meta stack_trace term_glyph test_api] - material_color_utilities 0.5.0 [collection] - meta 1.10.0 - nested 1.0.0 [flutter] - nm 0.5.0 [dbus] - octo_image 2.0.0 [flutter] - package_info_plus_platform_interface 2.0.1 [flutter meta plugin_platform_interface] - path 1.8.3 - path_parsing 1.0.1 [vector_math meta] - path_provider_android 2.2.2 [flutter path_provider_platform_interface] - path_provider_foundation 2.3.2 [flutter path_provider_platform_interface] - path_provider_linux 2.2.1 [ffi flutter path path_provider_platform_interface xdg_directories] - path_provider_platform_interface 2.1.2 [flutter platform plugin_platform_interface] - path_provider_windows 2.2.1 [ffi flutter path path_provider_platform_interface win32] - permission_handler_android 12.0.3 [flutter permission_handler_platform_interface] - permission_handler_apple 9.3.0 [flutter permission_handler_platform_interface] - permission_handler_html 0.1.1 [flutter flutter_web_plugins permission_handler_platform_interface] - permission_handler_platform_interface 4.1.0 [flutter meta plugin_platform_interface] - permission_handler_windows 0.2.1 [flutter permission_handler_platform_interface] - petitparser 6.0.2 [meta] - platform 3.1.4 - plugin_platform_interface 2.1.8 [meta] - pointycastle 3.7.4 [collection convert js] - share_plus_platform_interface 3.3.1 [cross_file flutter meta mime plugin_platform_interface path_provider uuid] - shared_preferences_android 2.2.1 [flutter shared_preferences_platform_interface] - shared_preferences_foundation 2.3.5 [flutter shared_preferences_platform_interface] - shared_preferences_linux 2.3.2 [file flutter path path_provider_linux path_provider_platform_interface shared_preferences_platform_interface] - shared_preferences_platform_interface 2.3.2 [flutter plugin_platform_interface] - shared_preferences_web 2.2.2 [flutter flutter_web_plugins shared_preferences_platform_interface web] - shared_preferences_windows 2.3.2 [file flutter path path_provider_platform_interface path_provider_windows shared_preferences_platform_interface] - sign_in_with_apple_platform_interface 1.0.0 [flutter plugin_platform_interface meta] - sign_in_with_apple_web 1.0.1 [flutter flutter_web_plugins sign_in_with_apple_platform_interface js] - simple_gesture_detector 0.2.0 [flutter] - sky_engine 0.0.99 - source_span 1.10.0 [collection path term_glyph] - sprintf 7.0.0 - sqflite 2.3.1 [flutter sqflite_common path] - sqflite_common 2.5.3 [synchronized path meta] - stack_trace 1.11.1 [path] - stream_channel 2.1.2 [async] - stream_transform 2.1.0 - string_scanner 1.2.0 [source_span] - synchronized 3.1.0+1 - term_glyph 1.2.1 - test_api 0.6.1 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph] - typed_data 1.3.2 [collection] - url_launcher_android 6.2.2 [flutter url_launcher_platform_interface] - url_launcher_ios 6.2.4 [flutter url_launcher_platform_interface] - url_launcher_linux 3.1.1 [flutter url_launcher_platform_interface] - url_launcher_macos 3.1.0 [flutter url_launcher_platform_interface] - url_launcher_platform_interface 2.3.1 [flutter plugin_platform_interface] - url_launcher_web 2.2.3 [flutter flutter_web_plugins url_launcher_platform_interface web] - url_launcher_windows 3.1.1 [flutter url_launcher_platform_interface] - vector_graphics 1.1.9+2 [flutter vector_graphics_codec] - vector_graphics_codec 1.1.9+2 - vector_graphics_compiler 1.1.9+2 [args meta path_parsing xml vector_graphics_codec path] - vector_math 2.1.4 - video_player_android 2.4.11 [flutter video_player_platform_interface] - video_player_avfoundation 2.5.6 [flutter video_player_platform_interface] - video_player_platform_interface 6.2.2 [flutter plugin_platform_interface] - video_player_web 2.1.3 [flutter flutter_web_plugins video_player_platform_interface] - web 0.3.0 - win32 5.2.0 [ffi] - win32_registry 1.1.2 [ffi win32] - xdg_directories 1.0.4 [meta path] - xml 6.5.0 [collection meta petitparser] - yaml 3.1.2 [collection source_span string_scanner] ```

danagbemava-nc commented 10 months ago

Hi @pafciu17, are you able to reproduce the crash locally or is it happening only in production?

If you are able to reproduce the crash locally, please provide steps to reproduce the issue so that we can investigate the issue.

Thank you

pafciu17 commented 10 months ago

Hi @danagbemava-nc, thank you for quick reply. Only in production - unfortunately, so far, I didn't manage to reproduce it myself.

danagbemava-nc commented 10 months ago

Hi @pafciu17, how are you triggering notifications for your app? Are you using the firebase admin sdk or another service to push the notifications?

pafciu17 commented 9 months ago

Hey @danagbemava-nc, yes, it is being handled with Firebase Admin SDK.

danagbemava-nc commented 9 months ago

Thanks for the info. One final thing, how many instances of this crash have you experience and how many users are affected by this?

pafciu17 commented 9 months ago

It would be 18 crashes, 12 users affected, within 6 days.

danagbemava-nc commented 9 months ago

Thanks for the update.

This looks similar to https://github.com/firebase/flutterfire/issues/11901 albeit at a different crash point.

Labeling based on the information provided above.

cc @russellwheatley

Lyokone commented 4 months ago

I'm cleaning up old issues and noticed this was a duplicate of https://github.com/firebase/flutterfire/issues/11901

The solution is probably to use the correct proguard settings.