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.72k stars 3.97k forks source link

🐛 [Firebase_Messaging] Severe crash in production pointing to `Attempt to read from field 'java.lang.String io.flutter.view.FlutterCallbackInformation.callbackLibraryPath' on a null object reference` #9345

Closed itssidhere closed 5 months ago

itssidhere commented 2 years ago

Bug report

Describe the bug Android repetitive crash on various devices

Additional context

As reported by crashlytics and also from users

Stacktrace

Click to expand ``` Fatal Exception: java.lang.NullPointerException: Attempt to read from field 'java.lang.String io.flutter.view.FlutterCallbackInformation.callbackLibraryPath' on a null object reference at io.flutter.embedding.engine.dart.DartExecutor$DartCallback.toString(DartExecutor.java:22) at java.lang.String.valueOf(String.java:2924) at java.lang.StringBuilder.append(StringBuilder.java:132) at io.flutter.embedding.engine.dart.DartExecutor.executeDartCallback(DartExecutor.java:27) at io.flutter.plugins.firebase.messaging.FlutterFirebaseMessagingBackgroundExecutor.lambda$startBackgroundIsolate$0(FlutterFirebaseMessagingBackgroundExecutor.java:100) at io.flutter.plugins.firebase.messaging.FlutterFirebaseMessagingBackgroundExecutor.lambda$startBackgroundIsolate$0$FlutterFirebaseMessagingBackgroundExecutor(FlutterFirebaseMessagingBackgroundExecutor.java) at io.flutter.plugins.firebase.messaging.-$$Lambda$FlutterFirebaseMessagingBackgroundExecutor$zxJ5LgPXbKxXUnPaKdrwAxLuPJc.run(-.java:8) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:257) at android.app.ActivityThread.main(ActivityThread.java:8183) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:626) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1015) ```

Flutter doctor

Run flutter doctor and paste the output below:

Click To Expand [√] Flutter (Channel stable, 3.0.5, on Microsoft Windows [Version 10.0.22000.856], locale en-US) [!] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1) X cmdline-tools component is missing Run `path/to/sdkmanager --install "cmdline-tools;latest"` See https://developer.android.com/studio/command-line for more details. X Android license status unknown. Run `flutter doctor --android-licenses` to accept the SDK licenses. See https://flutter.dev/docs/get-started/install/windows#android-setup for more details. [√] Chrome - develop for the web [!] Visual Studio - develop for Windows (Visual Studio Community 2019 16.11.17) X Visual Studio is missing necessary components. Please re-run the Visual Studio installer for the "Desktop development with C++" workload, and include these components: MSVC v142 - VS 2019 C++ x64/x86 build tools - If there are multiple build tool versions available, install the latest C++ CMake tools for Windows Windows 10 SDK [√] Android Studio (version 2021.2) [√] VS Code (version 1.70.1) [√] Connected device (3 available) [√] HTTP Host Availability ! Doctor found issues in 2 categories.

Flutter dependencies

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

Click To Expand Dart SDK 2.17.6 Flutter SDK 3.0.5 mohalla 0.1.4+1001 dependencies: - animations 2.0.3 [flutter] - audio_session 0.1.10 [flutter flutter_web_plugins rxdart meta] - audioplayers 0.20.1 [uuid path_provider http flutter flutter_web_plugins] - auto_size_text 3.0.0 [flutter] - awesome_dialog 2.2.1 [flutter simple_animations flare_flutter] - badges 2.0.3 [flutter] - better_player 0.0.82 [flutter cupertino_icons wakelock meta flutter_widget_from_html_core visibility_detector path_provider collection xml] - bubble 1.2.1 [flutter] - cloud_firestore 3.4.0 [cloud_firestore_platform_interface cloud_firestore_web collection firebase_core firebase_core_platform_interface flutter meta] - cloud_functions 3.3.3 [cloud_functions_platform_interface cloud_functions_web firebase_core firebase_core_platform_interface flutter] - collection 1.16.0 - device_info_plus 3.2.4 [flutter device_info_plus_platform_interface device_info_plus_macos device_info_plus_linux device_info_plus_web device_info_plus_windows] - dynamic_color 1.4.0 [flutter flutter_test material_color_utilities] - equatable 2.0.3 [collection meta] - extended_image 6.1.0 [extended_image_library flutter meta] - firebase_analytics 9.2.1 [firebase_analytics_platform_interface firebase_analytics_web firebase_core firebase_core_platform_interface flutter] - firebase_auth 3.4.2 [firebase_auth_platform_interface firebase_auth_web firebase_core firebase_core_platform_interface flutter meta] - firebase_core 1.20.0 [firebase_core_platform_interface firebase_core_web flutter meta] - firebase_crashlytics 2.8.6 [firebase_core firebase_core_platform_interface firebase_crashlytics_platform_interface flutter stack_trace] - firebase_database 9.0.20 [firebase_core firebase_core_platform_interface firebase_database_platform_interface firebase_database_web flutter] - firebase_dynamic_links 4.3.3 [firebase_core firebase_core_platform_interface firebase_dynamic_links_platform_interface flutter meta plugin_platform_interface] - firebase_in_app_messaging 0.6.0+20 [firebase_core firebase_core_platform_interface firebase_in_app_messaging_platform_interface flutter meta] - firebase_messaging 11.4.4 [firebase_core firebase_core_platform_interface firebase_messaging_platform_interface firebase_messaging_web flutter meta] - firebase_storage 10.3.3 [firebase_core firebase_core_platform_interface firebase_storage_platform_interface firebase_storage_web flutter] - flex_color_scheme 5.0.1 [flutter material_color_utilities] - flutter 0.0.0 [characters collection material_color_utilities meta vector_math sky_engine] - flutter_bloc 7.3.3 [flutter bloc provider] - flutter_colorpicker 1.0.3 [flutter] - flutter_datetime_picker 1.5.1 [flutter] - flutter_facebook_auth 4.4.0+1 [flutter flutter_facebook_auth_platform_interface flutter_facebook_auth_web] - flutter_linkify 5.0.2 [flutter linkify] - flutter_local_notifications 9.5.3+1 [clock flutter flutter_local_notifications_linux flutter_local_notifications_platform_interface timezone] - flutter_rating_bar 4.0.1 [flutter] - flutter_screenutil 5.5.3+2 [flutter] - flutter_slidable 1.3.2 [flutter] - flutter_sound 9.2.13 [path_provider recase uuid provider path synchronized logger flutter flutter_sound_platform_interface flutter_sound_web] - flutter_spinkit 5.1.0 [flutter] - flutter_staggered_grid_view 0.6.2 [flutter] - flutter_typeahead 3.2.7 [flutter flutter_keyboard_visibility] - flutter_vibrate 1.3.0 [flutter] - fluttertoast 8.0.9 [flutter flutter_web_plugins] - font_awesome_flutter 10.1.0 [flutter] - get 4.6.5 [flutter] - get_it 7.2.0 [async collection] - giphy_get 3.0.5 [flutter flutter_localizations provider extended_image flutter_staggered_grid_view meta http url_launcher] - google_fonts 3.0.1 [flutter http path_provider crypto] - google_sign_in 5.4.0 [flutter google_sign_in_android google_sign_in_ios google_sign_in_platform_interface google_sign_in_web] - hive 2.2.3 [meta crypto] - hive_flutter 1.1.0 [flutter hive path_provider path] - image_cropper 2.0.3 [flutter image_cropper_platform_interface image_cropper_for_web] - image_gallery_saver 1.7.1 [flutter] - image_picker 0.8.5+3 [flutter image_picker_android image_picker_for_web image_picker_ios image_picker_platform_interface] - implicitly_animated_reorderable_list 0.4.2 [flutter async meta] - in_app_purchase 3.0.6 [flutter in_app_purchase_android in_app_purchase_platform_interface in_app_purchase_storekit] - in_app_update 3.0.0 [flutter] - infinite_scroll_pagination 3.2.0 [flutter sliver_tools] - intl 0.17.0 [clock path] - json_annotation 4.6.0 [meta] - like_button 2.0.4 [flutter] - local_auth 2.1.0 [flutter intl local_auth_android local_auth_ios local_auth_platform_interface local_auth_windows] - lottie 1.3.0 [archive flutter path vector_math] - page_transition 2.0.9 [flutter] - paginate_firestore 1.0.3 [flutter bloc flutter_bloc cloud_firestore provider] - palette_generator 0.3.3 [collection flutter path] - path_provider 2.0.11 [flutter path_provider_android path_provider_ios path_provider_linux path_provider_macos path_provider_platform_interface path_provider_windows] - permission_handler 10.0.0 [flutter meta permission_handler_android permission_handler_apple permission_handler_windows permission_handler_platform_interface] - photo_view 0.13.0 [flutter] - profanity_filter 2.0.0 - provider 6.0.3 [collection flutter nested] - random_color 1.0.6-nullsafety [flutter] - rate_my_app 1.1.2 [shared_preferences flutter_rating_bar flutter] - readmore 2.2.0 [flutter] - screenshot 1.2.3 [flutter] - select_dialog 2.0.0 [flutter] - share_plus 4.0.10 [meta mime flutter share_plus_platform_interface share_plus_linux share_plus_macos share_plus_windows share_plus_web] - shimmer 2.0.0 [flutter] - slider_button 1.0.0 [vibration flutter] - smooth_page_indicator 1.0.0+2 [flutter] - swipe_to 1.0.2 [flutter] - timeago 3.2.2 - transparent_image 2.0.0 - tutorial_coach_mark 1.2.3 [flutter] - url_launcher 6.1.5 [flutter url_launcher_android url_launcher_ios url_launcher_linux url_launcher_macos url_launcher_platform_interface url_launcher_web url_launcher_windows] - uuid 3.0.6 [crypto] - wakelock 0.6.2 [flutter meta wakelock_macos wakelock_platform_interface wakelock_web wakelock_windows] - youtube_explode_dart 1.11.0 [collection freezed_annotation html http http_parser json_annotation meta xml] dev dependencies: - build_runner 2.2.0 [args async analyzer build build_config build_daemon build_resolvers build_runner_core code_builder collection crypto dart_style frontend_server_client glob graphs http_multi_server io js logging meta mime package_config path pool pub_semver pubspec_parse shelf shelf_web_socket stack_trace stream_transform timing watcher web_socket_channel yaml] - hive_generator 1.1.3 [build source_gen hive analyzer source_helper] - json_serializable 6.3.1 [analyzer async build build_config collection json_annotation meta path pub_semver pubspec_parse source_gen source_helper] - pedantic 1.11.1 transitive dependencies: - _fe_analyzer_shared 40.0.0 [meta] - analyzer 4.1.0 [_fe_analyzer_shared collection convert crypto glob meta package_config path pub_semver source_span watcher yaml] - archive 3.3.1 [crypto path] - args 2.3.1 - async 2.8.2 [collection meta] - bloc 7.2.1 [meta] - boolean_selector 2.1.0 [source_span string_scanner] - build 2.3.0 [analyzer async convert crypto glob logging meta path] - build_config 1.1.0 [checked_yaml json_annotation path pubspec_parse yaml] - build_daemon 3.1.0 [built_collection built_value http_multi_server logging path pool shelf shelf_web_socket stream_transform watcher web_socket_channel] - build_resolvers 2.0.9 [analyzer async build crypto graphs logging path package_config pool pub_semver stream_transform yaml] - build_runner_core 7.2.3 [async build build_config build_resolvers collection convert crypto glob graphs json_annotation logging meta path package_config pool timing watcher yaml] - built_collection 5.1.1 - built_value 8.4.0 [built_collection collection fixnum meta] - characters 1.2.0 - charcode 1.3.1 - checked_yaml 2.0.1 [json_annotation source_span yaml] - clock 1.1.0 - cloud_firestore_platform_interface 5.7.0 [collection firebase_core flutter meta plugin_platform_interface] - cloud_firestore_web 2.8.0 [cloud_firestore_platform_interface collection firebase_core firebase_core_web flutter flutter_web_plugins js] - cloud_functions_platform_interface 5.1.12 [firebase_core flutter meta plugin_platform_interface] - cloud_functions_web 4.3.1 [cloud_functions_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins js] - code_builder 4.1.0 [built_collection built_value collection matcher meta] - convert 3.0.2 [typed_data] - cross_file 0.3.3+1 [js meta] - crypto 3.0.2 [typed_data] - csslib 0.17.2 [source_span] - cupertino_icons 1.0.5 - dart_style 2.2.3 [analyzer args path pub_semver source_span] - dbus 0.7.3 [args ffi meta xml] - device_info_plus_linux 2.1.1 [device_info_plus_platform_interface file flutter meta] - device_info_plus_macos 2.2.3 [device_info_plus_platform_interface flutter] - device_info_plus_platform_interface 2.3.0+1 [flutter meta plugin_platform_interface] - device_info_plus_web 2.1.0 [device_info_plus_platform_interface flutter_web_plugins flutter] - device_info_plus_windows 2.1.1 [device_info_plus_platform_interface ffi flutter win32] - extended_image_library 3.2.0 [crypto flutter http_client_helper path path_provider] - fake_async 1.3.0 [clock collection] - ffi 1.2.1 - file 6.1.2 [meta path] - firebase_analytics_platform_interface 3.2.1 [firebase_core flutter meta plugin_platform_interface] - firebase_analytics_web 0.4.1+1 [firebase_analytics_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins js] - firebase_auth_platform_interface 6.3.2 [firebase_core flutter meta plugin_platform_interface] - firebase_auth_web 4.0.0 [firebase_auth_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins http_parser intl js meta] - firebase_core_platform_interface 4.5.0 [collection flutter flutter_test meta plugin_platform_interface] - firebase_core_web 1.7.1 [firebase_core_platform_interface flutter flutter_web_plugins js meta] - firebase_crashlytics_platform_interface 3.2.12 [collection firebase_core flutter meta plugin_platform_interface] - firebase_database_platform_interface 0.2.1+12 [collection firebase_core flutter meta plugin_platform_interface] - firebase_database_web 0.2.1+1 [firebase_core firebase_core_web firebase_database_platform_interface flutter flutter_web_plugins js] - firebase_dynamic_links_platform_interface 0.2.3+8 [firebase_core flutter meta plugin_platform_interface] - firebase_in_app_messaging_platform_interface 0.2.1+12 [firebase_core flutter meta plugin_platform_interface] - firebase_messaging_platform_interface 3.5.4 [firebase_core flutter meta plugin_platform_interface] - firebase_messaging_web 2.4.4 [firebase_core firebase_core_web firebase_messaging_platform_interface flutter flutter_web_plugins js meta] - firebase_storage_platform_interface 4.1.12 [collection firebase_core flutter meta plugin_platform_interface] - firebase_storage_web 3.3.1 [async firebase_core firebase_core_web firebase_storage_platform_interface flutter flutter_web_plugins http js meta] - fixnum 1.0.1 - flare_flutter 3.0.2 [collection flutter meta] - flutter_facebook_auth_platform_interface 3.2.0 [flutter plugin_platform_interface] - flutter_facebook_auth_web 3.2.0 [flutter flutter_web_plugins js flutter_facebook_auth_platform_interface] - flutter_keyboard_visibility 5.3.0 [meta flutter_keyboard_visibility_platform_interface flutter_keyboard_visibility_web 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_local_notifications_linux 0.4.2 [flutter flutter_local_notifications_platform_interface dbus path xdg_directories] - flutter_local_notifications_platform_interface 5.0.0 [flutter plugin_platform_interface] - flutter_localizations 0.0.0 [flutter intl characters clock collection material_color_utilities meta path vector_math] - flutter_plugin_android_lifecycle 2.0.7 [flutter] - flutter_sound_platform_interface 9.2.13 [flutter meta plugin_platform_interface logger] - flutter_sound_web 9.2.13 [flutter_sound_platform_interface flutter logger flutter_web_plugins meta js] - flutter_test 0.0.0 [flutter test_api path fake_async clock stack_trace vector_math async boolean_selector characters charcode collection matcher material_color_utilities meta source_span stream_channel string_scanner term_glyph] - flutter_web_plugins 0.0.0 [flutter js characters collection material_color_utilities meta vector_math] - flutter_widget_from_html_core 0.8.5+3 [csslib flutter fwfh_text_style html] - freezed_annotation 1.1.0 [collection json_annotation meta] - frontend_server_client 2.1.3 [async path] - fwfh_text_style 2.7.3+2 [flutter] - glob 2.1.0 [async collection file path string_scanner] - google_sign_in_android 6.0.1 [flutter google_sign_in_platform_interface] - google_sign_in_ios 5.4.0 [flutter google_sign_in_platform_interface] - google_sign_in_platform_interface 2.2.0 [flutter quiver] - google_sign_in_web 0.10.2 [flutter flutter_web_plugins google_sign_in_platform_interface js] - graphs 2.1.0 [collection] - html 0.15.0 [csslib source_span] - http 0.13.4 [async http_parser meta path] - http_client_helper 2.0.2 [http] - http_multi_server 3.2.1 [async] - http_parser 4.0.1 [collection source_span string_scanner typed_data] - image_cropper_for_web 0.0.4 [flutter flutter_web_plugins image_cropper_platform_interface js] - image_cropper_platform_interface 2.0.0 [flutter plugin_platform_interface http] - image_picker_android 0.8.5+1 [flutter flutter_plugin_android_lifecycle image_picker_platform_interface] - image_picker_for_web 2.1.8 [flutter flutter_web_plugins image_picker_platform_interface] - image_picker_ios 0.8.5+6 [flutter image_picker_platform_interface] - image_picker_platform_interface 2.5.0 [cross_file flutter http plugin_platform_interface] - in_app_purchase_android 0.2.3+1 [collection flutter in_app_purchase_platform_interface json_annotation] - in_app_purchase_platform_interface 1.3.1 [flutter plugin_platform_interface] - in_app_purchase_storekit 0.3.1 [collection flutter in_app_purchase_platform_interface json_annotation] - io 1.0.3 [meta path string_scanner] - js 0.6.4 - linkify 4.1.0 - local_auth_android 1.0.6 [flutter flutter_plugin_android_lifecycle intl local_auth_platform_interface] - local_auth_ios 1.0.7 [flutter intl local_auth_platform_interface] - local_auth_platform_interface 1.0.4 [flutter intl plugin_platform_interface] - local_auth_windows 1.0.1 [flutter local_auth_platform_interface] - logger 1.1.0 - logging 1.0.2 - matcher 0.12.11 [stack_trace] - material_color_utilities 0.1.4 - meta 1.7.0 - mime 1.0.2 - nested 1.0.0 [flutter] - package_config 2.1.0 [path] - path 1.8.1 - path_provider_android 2.0.14 [flutter path_provider_platform_interface] - path_provider_ios 2.0.9 [flutter path_provider_platform_interface] - path_provider_linux 2.1.7 [ffi flutter path path_provider_platform_interface xdg_directories] - path_provider_macos 2.0.6 [flutter path_provider_platform_interface] - path_provider_platform_interface 2.0.4 [flutter platform plugin_platform_interface] - path_provider_windows 2.0.7 [ffi flutter path path_provider_platform_interface win32] - permission_handler_android 10.0.0 [flutter permission_handler_platform_interface] - permission_handler_apple 9.0.4 [flutter permission_handler_platform_interface] - permission_handler_platform_interface 3.7.0 [flutter meta plugin_platform_interface] - permission_handler_windows 0.1.0 [flutter permission_handler_platform_interface] - petitparser 5.0.0 [meta] - platform 3.1.0 - plugin_platform_interface 2.1.2 [meta] - pool 1.5.1 [async stack_trace] - process 4.2.4 [file path platform] - pub_semver 2.1.1 [collection meta] - pubspec_parse 1.2.0 [checked_yaml collection json_annotation pub_semver yaml] - quiver 3.1.0 [matcher] - recase 4.0.0 - rxdart 0.27.5 - share_plus_linux 3.0.0 [share_plus_platform_interface file flutter meta url_launcher] - share_plus_macos 3.0.1 [share_plus_platform_interface flutter] - share_plus_platform_interface 3.0.3 [flutter meta mime plugin_platform_interface] - share_plus_web 3.0.1 [share_plus_platform_interface url_launcher flutter flutter_web_plugins meta] - share_plus_windows 3.0.1 [share_plus_platform_interface flutter meta url_launcher] - shared_preferences 2.0.15 [flutter shared_preferences_android shared_preferences_ios shared_preferences_linux shared_preferences_macos shared_preferences_platform_interface shared_preferences_web shared_preferences_windows] - shared_preferences_android 2.0.12 [flutter shared_preferences_platform_interface] - shared_preferences_ios 2.1.1 [flutter shared_preferences_platform_interface] - shared_preferences_linux 2.1.1 [file flutter path path_provider_linux path_provider_platform_interface shared_preferences_platform_interface] - shared_preferences_macos 2.0.4 [flutter shared_preferences_platform_interface] - shared_preferences_platform_interface 2.0.0 [flutter] - shared_preferences_web 2.0.4 [flutter flutter_web_plugins shared_preferences_platform_interface] - shared_preferences_windows 2.1.1 [file flutter path path_provider_platform_interface path_provider_windows shared_preferences_platform_interface] - shelf 1.3.1 [async collection http_parser path stack_trace stream_channel] - shelf_web_socket 1.0.2 [shelf stream_channel web_socket_channel] - simple_animations 4.0.2 [flutter collection] - sky_engine 0.0.99 - sliver_tools 0.2.7 [flutter] - source_gen 1.2.2 [analyzer async build dart_style glob meta path source_span yaml] - source_helper 1.3.2 [analyzer collection source_gen] - source_span 1.8.2 [collection path term_glyph] - stack_trace 1.10.0 [path] - stream_channel 2.1.0 [async] - stream_transform 2.0.0 - string_scanner 1.1.0 [charcode source_span] - synchronized 3.0.0+2 - term_glyph 1.2.0 - test_api 0.4.9 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph matcher] - timezone 0.8.0 [path] - timing 1.0.0 [json_annotation] - typed_data 1.3.0 [collection] - url_launcher_android 6.0.17 [flutter url_launcher_platform_interface] - url_launcher_ios 6.0.17 [flutter url_launcher_platform_interface] - url_launcher_linux 3.0.1 [flutter url_launcher_platform_interface] - url_launcher_macos 3.0.1 [flutter url_launcher_platform_interface] - url_launcher_platform_interface 2.1.0 [flutter plugin_platform_interface] - url_launcher_web 2.0.12 [flutter flutter_web_plugins url_launcher_platform_interface] - url_launcher_windows 3.0.1 [flutter url_launcher_platform_interface] - vector_math 2.1.2 - vibration 1.7.4-nullsafety.0 [flutter vibration_web] - vibration_web 1.6.3-nullsafety.0 [flutter flutter_web_plugins] - visibility_detector 0.2.2 [flutter] - wakelock_macos 0.4.0 [flutter flutter_web_plugins wakelock_platform_interface] - wakelock_platform_interface 0.3.0 [flutter meta] - wakelock_web 0.4.0 [flutter flutter_web_plugins js wakelock_platform_interface] - wakelock_windows 0.2.0 [flutter wakelock_platform_interface win32] - watcher 1.0.1 [async path] - web_socket_channel 2.2.0 [async crypto stream_channel] - win32 2.5.2 [ffi] - xdg_directories 0.2.0+1 [meta path process] - xml 5.4.1 [collection meta petitparser] - yaml 3.1.1 [collection source_span string_scanner]

darshankawar commented 2 years ago

Fatal Exception: java.lang.NullPointerException: Attempt to read from field 'java.lang.String io.flutter.view.FlutterCallbackInformation.callbackLibraryPath' on a null object reference at io.flutter.embedding.engine.dart.DartExecutor$DartCallback.toString(DartExecutor.java:22) at java.lang.String.valueOf(String.java:2924) at java.lang.StringBuilder.append(StringBuilder.java:132) at io.flutter.embedding.engine.dart.DartExecutor.executeDartCallback(DartExecutor.java:27) at io.flutter.plugins.firebase.messaging.FlutterFirebaseMessagingBackgroundExecutor.lambda$startBackgroundIsolate$0(FlutterFirebaseMessagingBackgroundExecutor.java:100) at io.flutter.plugins.firebase.messaging.FlutterFirebaseMessagingBackgroundExecutor.lambda$startBackgroundIsolate$0$FlutterFirebaseMessagingBackgroundExecutor(FlutterFirebaseMessagingBackgroundExecutor.java) at io.flutter.plugins.firebase.messaging.-$$Lambda$FlutterFirebaseMessagingBackgroundExecutor$zxJ5LgPXbKxXUnPaKdrwAxLuPJc.run(-.java:8)

Looks similar to other issues reported: https://github.com/firebase/flutterfire/issues/9332, https://github.com/firebase/flutterfire/issues/9244

Keeping this issue open and labeling based on stack-trace.

/cc @russellwheatley

ljmatan commented 2 years ago

Hey @darshankawar replicable steps are:

  1. Implement FCM to Flutter (code examples can be found here.
  2. App is in background, notification arrives, user clicks on notification.

This was confirmed on Android 10 and 12.

Flutter doctor: Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel master, 3.1.0-0.0.pre.2191, on macOS 12.0.1 21A559 darwin-arm, locale en-GB) [✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 13.4) [✓] Chrome - develop for the web [✓] Android Studio (version 2021.1) [✓] VS Code (version 1.70.1) [✓] VS Code (version 1.71.0-insider) [✓] Connected device (4 available) [✓] HTTP Host Availability

• No issues found! threeofthem@Threes-Mac-mini ~ %

arfuhad commented 2 years ago

I have faced same issue for OPPO F11 Android 11.

ljmatan commented 2 years ago

We've fixed the issue by not using background message handler. There are also some steps that have been updated in the documentation since we've first implemented the library.

apelsinkach commented 2 years ago

Same here for Nokia G21, used this example, also tried this, but got same error.

russellwheatley commented 1 year ago

If you can provide a reproduction, we can look into this issue.

milanjaros commented 1 year ago

Hi @russellwheatley, I'm afraid we can't provide more details than we see in Crashlytics. We were still unable to reproduce the issue even if we noticed it in October. Some data from Crashlytics for last two weeks: issues devices Stacktrace:


Fatal Exception: java.lang.NullPointerException: Attempt to read from field 'java.lang.String io.flutter.view.FlutterCallbackInformation.callbackLibraryPath' on a null object reference in method 'java.lang.String io.flutter.embedding.engine.dart.DartExecutor$DartCallback.toString()'
       at io.flutter.embedding.engine.dart.DartExecutor$DartCallback.toString(DartExecutor.java:421)
       at java.lang.String.valueOf(String.java:3657)
       at java.lang.StringBuilder.append(StringBuilder.java:132)
       at io.flutter.embedding.engine.dart.DartExecutor.executeDartCallback(DartExecutor.java:175)
       at io.flutter.plugins.firebase.messaging.FlutterFirebaseMessagingBackgroundExecutor.lambda$startBackgroundIsolate$0(FlutterFirebaseMessagingBackgroundExecutor.java:183)
       at io.flutter.plugins.firebase.messaging.FlutterFirebaseMessagingBackgroundExecutor.$r8$lambda$zxJ5LgPXbKxXUnPaKdrwAxLuPJc(FlutterFirebaseMessagingBackgroundExecutor.java)
       at io.flutter.plugins.firebase.messaging.FlutterFirebaseMessagingBackgroundExecutor$$InternalSyntheticLambda$0$00bc0dc69f6f50c614bbeb2ae38bd5fe57f5f195b45bc25d1b4afc0273025e9c$0.run(FlutterFirebaseMessagingBackgroundExecutor.java:8)
       at android.os.Handler.handleCallback(Handler.java:938)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loopOnce(Looper.java:233)
       at android.os.Looper.loop(Looper.java:334)
       at android.app.ActivityThread.main(ActivityThread.java:8287)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:582)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1065)
milanjaros commented 1 year ago

Hi, look into FlutterFirebaseMessagingBackgroundExecutor.startBackgroundIsolate(), inside those lambdas, my opinion is it is crashing on executor.executeDartCallback(dartCallback) where the appBundlePath is (probably) null. Is it possible that in a particular app state, the loader.findAppBundlePath() returns the null? [The docs](https://api.flutter.dev/javadoc/io/flutter/embedding/engine/loader/FlutterLoader.html#findAppBundlePath()) doesn't say much, just that it is NonNull.

I've found that christocracy suggested to use FlutterInjector.instance().flutterLoader().findAppBundlePath().

@russellwheatley, @darshankawar, please, could you verify this with someone?

apelsinkach commented 1 year ago

Still here on Samsung M23 (android 13)! Any updates?

mesutiotiq commented 11 months ago

I also encountered this issue on Google Pixel 5, Android 13. Is there any solution?

Jai05-techie commented 10 months ago

I also encountered the same issue, which was reported in Crashlytics.

firebase_messaging: ^14.3.0

Fatal Exception: java.lang.NullPointerException: Attempt to read from field 'java.lang.String io.flutter.view.FlutterCallbackInformation.callbackLibraryPath' on a null object reference in method 'java.lang.String io.flutter.embedding.engine.dart.DartExecutor$DartCallback.toString()'
       at io.flutter.embedding.engine.dart.DartExecutor$DartCallback.toString(:22)
       at java.lang.String.valueOf(String.java:4092)
       at java.lang.StringBuilder.append(StringBuilder.java:179)
       at io.flutter.embedding.engine.dart.DartExecutor.executeDartCallback(DartExecutor.java:27)
       at io.flutter.plugins.firebase.messaging.FlutterFirebaseMessagingBackgroundExecutor.lambda$startBackgroundIsolate$0(FlutterFirebaseMessagingBackgroundExecutor.java:100)
       at android.os.Handler.handleCallback(Handler.java:938)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loopOnce(Looper.java:211)
       at android.os.Looper.loop(Looper.java:300)
       at android.app.ActivityThread.main(ActivityThread.java:8322)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:556)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1038)
Screenshot 2024-01-01 at 11 27 40 AM
russellwheatley commented 10 months ago

@Jai05-techie - We have a possible solution merged in: https://github.com/firebase/flutterfire/pull/12057

It will be rolled out in the next release 🙏

atrope commented 9 months ago

With this "fix" we started getting Android 5 ANRs

Screen Shot 2024-01-31 at 11 23 45

StavckTrace.txt

felipecastrosales commented 9 months ago

With this "fix" we started getting Android 5 ANRs

Screen Shot 2024-01-31 at 11 23 45

StavckTrace.txt

same issue here, @russellwheatley can you help us in this case?

russellwheatley commented 9 months ago

Hey @atrope @felipecastrosales - so as a result of this change, you're now receiving ANR reports (i.e. you were not receiving them previously)?

Out of curiosity, were you also experiencing the crashes that have been described in this issue before the potential solution was rolled out?

atrope commented 9 months ago

Hey @russellwheatley Yes as a result of this fix.

I Do not see that other crash in our crashlytics nor vitals

atrope commented 9 months ago

Hi Guys, any news on that front?

Jai05-techie commented 8 months ago

Hi,

We are facing the same issue again after upgrading to firebase_messaging: ^14.7.10.

Fatal Exception: java.lang.NullPointerException: Attempt to read from field 'java.lang.String io.flutter.view.FlutterCallbackInformation.callbackLibraryPath' on a null object reference in method 'java.lang.String io.flutter.embedding.engine.dart.DartExecutor$DartCallback.toString()'
       at io.flutter.embedding.engine.dart.DartExecutor$DartCallback.toString(:22)
       at java.lang.String.valueOf(String.java:4092)
       at java.lang.StringBuilder.append(StringBuilder.java:179)
       at io.flutter.embedding.engine.dart.DartExecutor.executeDartCallback(:27)
       at io.flutter.plugins.firebase.messaging.FlutterFirebaseMessagingBackgroundExecutor.lambda$startBackgroundIsolate$0(FlutterFirebaseMessagingBackgroundExecutor.java:119)
       at android.os.Handler.handleCallback(Handler.java:938)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loopOnce(Looper.java:211)
       at android.os.Looper.loop(Looper.java:300)
       at android.app.ActivityThread.main(ActivityThread.java:8322)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:556)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1038)
Screenshot 2024-02-27 at 10 41 38 AM
russellwheatley commented 8 months ago

@atrope - I will roll back the attempt at fixing for the next release 👍

russellwheatley commented 8 months ago

@atrope - I've reverted the changes. Will be out in the next release which is imminent 👍

SdxCoder commented 5 months ago

Hi, im facing the same error on firebase_messaging: 14.7.19

       at io.flutter.embedding.engine.dart.DartExecutor$DartCallback.toString(:22)
       at java.lang.String.valueOf(String.java:4092)
       at java.lang.StringBuilder.append(StringBuilder.java:179)
       at io.flutter.embedding.engine.dart.DartExecutor.executeDartCallback(:28)
       at io.flutter.plugins.firebase.messaging.FlutterFirebaseMessagingBackgroundExecutor.lambda$startBackgroundIsolate$0(FlutterFirebaseMessagingBackgroundExecutor.java:100)
       at android.os.Handler.handleCallback(Handler.java:942)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loopOnce(Looper.java:211)
       at android.os.Looper.loop(Looper.java:300)
       at android.app.ActivityThread.main(ActivityThread.java:8324)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:581)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1028)
Screenshot 2024-05-23 at 1 30 09 PM
flvlk commented 5 months ago

Hi, I have the same error on firebase_messaging 14.1.1 :

      Fatal Exception: java.lang.NullPointerException: Attempt to read from field 'java.lang.String io.flutter.view.FlutterCallbackInformation.callbackLibraryPath' on a null object reference in method 'java.lang.String e8.a$b.toString()'
       at io.flutter.embedding.engine.dart.DartExecutor$DartCallback.toString(DartExecutor.java:22)
       at java.lang.String.valueOf(String.java:4092)
       at java.lang.StringBuilder.append(StringBuilder.java:179)
       at io.flutter.embedding.engine.dart.DartExecutor.executeDartCallback(DartExecutor.java:27)
       at io.flutter.plugins.firebase.messaging.FlutterFirebaseMessagingBackgroundExecutor.lambda$startBackgroundIsolate$0(FlutterFirebaseMessagingBackgroundExecutor.java:119)
       at android.os.Handler.handleCallback(Handler.java:959)
       at android.os.Handler.dispatchMessage(Handler.java:100)
       at android.os.Looper.loopOnce(Looper.java:232)
       at android.os.Looper.loop(Looper.java:317)
       at android.app.ActivityThread.main(ActivityThread.java:8501)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878)

Any news if the bug have been fixed on the lastest version?