Closed akshatshah closed 3 years ago
@akshatshah The error log seems to be similar to https://github.com/FirebaseExtended/flutterfire/issues/6087 and will probably have same root-cause for the fix, so I am going ahead and closing this in favor of it. You can follow-up in it with your findings.
@darshankawar the issue is that the fix mentioned in that issue is not applicable in my situation. I can't just not initialize the firebase sdk because I need to use it in the background handler. I tried removing it and it completely stopped the location updates.
Bug report
I am facing a similar problem to #6087 and seeing lots of crashes. I am using flutter_background_geolocation and calling a function that initializes firebase and updates the location to firestore in the background. I am not sure if the solution mentioned is something applicable in my situation because I think I do need to initialize the firebase app inside the handler to be able update the location on firestore.
Steps to reproduce
I have been able to reproduce it by switching off the device and turning it back on. There is a crash a little bit after the location service is initialized. Hereβs the relevant code:
Additional context
I have disabled persistence everywhere and even tried updating the location using an API call instead of using the firestore package and the issue still persists (I still initialized firebase and used firebase auth to get the token).
Logs
Flutter doctor
Run
flutter doctor
and paste the output below:Click To Expand
``` Doctor summary (to see all details, run flutter doctor -v): [β] Flutter (Channel stable, 2.5.3, on Mac OS X 10.15.7 19H114 darwin-x64, locale en-US) [β] Android toolchain - develop for Android devices (Android SDK version 31.0.0) [β] Xcode - develop for iOS and macOS [β] Chrome - develop for the web [β] Android Studio [β] Android Studio (version 4.1) [β] VS Code (version 1.61.2) [β] Connected device (3 available) ```Flutter dependencies
Run
flutter pub deps -- --style=compact
and paste the output below:Click To Expand
``` - auto_size_text 2.1.0 [flutter] - bot_toast 4.0.1 [flutter] - cached_network_image 3.1.0 [flutter flutter_cache_manager octo_image cached_network_image_platform_interface cached_network_image_web] - cloud_firestore 2.5.0 [cloud_firestore_platform_interface cloud_firestore_web collection firebase_core firebase_core_platform_interface flutter meta] - cloud_functions 3.0.5 [cloud_functions_platform_interface cloud_functions_web firebase_core firebase_core_platform_interface flutter] - cupertino_icons 1.0.0 - device_info_plus 2.1.0 [flutter device_info_plus_platform_interface device_info_plus_linux device_info_plus_macos device_info_plus_web device_info_plus_windows] - device_preview 0.7.4 [flutter flutter_localizations provider path_provider device_frame font_awesome_flutter http freezed_annotation json_annotation shared_preferences pedantic path] - dio 4.0.0 [http_parser path] - firebase_auth 3.1.4 [firebase_auth_platform_interface firebase_auth_web firebase_core firebase_core_platform_interface flutter meta] - firebase_core 1.8.0 [firebase_core_platform_interface firebase_core_web flutter meta] - firebase_crashlytics 2.2.4 [firebase_core firebase_core_platform_interface firebase_crashlytics_platform_interface flutter stack_trace] - firebase_messaging 10.0.9 [firebase_core firebase_core_platform_interface firebase_messaging_platform_interface firebase_messaging_web flutter meta] - firebase_remote_config 0.11.0+2 [firebase_core firebase_core_platform_interface firebase_remote_config_platform_interface flutter] - firebase_storage 10.0.6 [firebase_core firebase_core_platform_interface firebase_storage_platform_interface firebase_storage_web flutter] - flutter 0.0.0 [characters collection meta typed_data vector_math sky_engine] - flutter_background_geolocation 4.3.0 [flutter collection background_fetch] - flutter_localizations 0.0.0 [flutter intl characters clock collection meta path typed_data vector_math] - flutter_typeahead 3.2.0 [flutter flutter_keyboard_visibility] - flutter_vibrate 1.3.0 [flutter] - georange 1.0.0 - get_it 6.0.0 [async collection] - google_maps_webservice 0.0.20-nullsafety.5 [http meta json_annotation] - image_picker 0.7.3 [flutter flutter_plugin_android_lifecycle image_picker_platform_interface image_picker_for_web] - intl 0.17.0 [clock path] - map_launcher 2.1.1 [flutter] - package_info 2.0.2 [flutter] - path_provider 2.0.1 [flutter path_provider_platform_interface path_provider_macos path_provider_linux path_provider_windows] - percent_indicator 3.3.0-nullsafety.1 [flutter] - provider 5.0.0 [collection flutter nested] - quiver 3.0.1 [matcher] - responsive_builder 0.4.1 [flutter] - share_plus 2.1.4 [meta mime flutter share_plus_platform_interface share_plus_linux share_plus_macos share_plus_windows share_plus_web] - shared_preferences 2.0.5 [meta flutter shared_preferences_platform_interface shared_preferences_linux shared_preferences_macos shared_preferences_web shared_preferences_windows] - url_launcher 6.0.9 [flutter meta url_launcher_linux url_launcher_macos url_launcher_platform_interface url_launcher_web url_launcher_windows] dev dependencies: - flutter_launcher_icons 0.9.2 [args image path yaml] - flutter_lints 1.0.4 [lints] - flutter_native_splash 1.2.3 [args image meta path xml yaml universal_io] - flutter_test 0.0.0 [flutter test_api path fake_async clock stack_trace vector_math async boolean_selector characters charcode collection matcher meta source_span stream_channel string_scanner term_glyph typed_data] transitive dependencies: - archive 3.1.2 [crypto path] - args 2.2.0 - async 2.8.1 [collection meta] - background_fetch 1.0.1 [flutter] - boolean_selector 2.1.0 [source_span string_scanner] - cached_network_image_platform_interface 1.0.0 [flutter flutter_cache_manager] - cached_network_image_web 1.0.1 [flutter flutter_cache_manager cached_network_image_platform_interface] - characters 1.1.0 - charcode 1.3.1 - clock 1.1.0 - cloud_firestore_platform_interface 5.4.3 [collection firebase_core flutter meta plugin_platform_interface] - cloud_firestore_web 2.4.4 [cloud_firestore_platform_interface collection firebase_core firebase_core_web flutter flutter_web_plugins js] - cloud_functions_platform_interface 5.0.12 [firebase_core flutter meta plugin_platform_interface] - cloud_functions_web 4.0.14 [cloud_functions_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins js] - collection 1.15.0 - crypto 3.0.1 [collection typed_data] - device_frame 0.4.2 [flutter_svg path_drawing freezed_annotation flutter] - device_info_plus_linux 2.1.0 [device_info_plus_platform_interface file flutter meta] - device_info_plus_macos 2.1.0 [device_info_plus_platform_interface flutter] - device_info_plus_platform_interface 2.1.0 [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.0 [device_info_plus_platform_interface ffi flutter win32] - fake_async 1.2.0 [clock collection] - ffi 1.0.0 - file 6.1.0 [meta path] - firebase_auth_platform_interface 6.1.2 [firebase_core flutter meta plugin_platform_interface] - firebase_auth_web 3.1.3 [firebase_auth_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins http_parser intl js meta] - firebase_core_platform_interface 4.0.1 [collection flutter meta plugin_platform_interface] - firebase_core_web 1.1.0 [firebase_core_platform_interface flutter flutter_web_plugins js meta] - firebase_crashlytics_platform_interface 3.1.4 [collection firebase_core flutter meta plugin_platform_interface] - firebase_messaging_platform_interface 3.0.7 [firebase_core flutter meta plugin_platform_interface] - firebase_messaging_web 2.0.7 [firebase_core firebase_core_web firebase_messaging_platform_interface flutter flutter_web_plugins js meta] - firebase_remote_config_platform_interface 0.3.0+7 [firebase_core flutter meta plugin_platform_interface] - firebase_storage_platform_interface 4.0.4 [collection firebase_core flutter meta plugin_platform_interface] - firebase_storage_web 3.0.4 [async firebase_core firebase_core_web firebase_storage_platform_interface flutter flutter_web_plugins http js meta] - flutter_blurhash 0.6.0 [flutter meta pedantic] - flutter_cache_manager 3.1.2 [clock collection file flutter http path path_provider pedantic rxdart sqflite uuid] - flutter_keyboard_visibility 5.0.3 [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_plugin_android_lifecycle 2.0.0 [flutter] - flutter_svg 0.22.0 [flutter meta path_drawing vector_math xml] - flutter_web_plugins 0.0.0 [flutter js characters collection meta typed_data vector_math] - font_awesome_flutter 9.1.0 [flutter] - freezed_annotation 0.14.2 [collection json_annotation meta] - http 0.13.1 [http_parser meta path pedantic] - http_parser 4.0.0 [charcode collection source_span string_scanner typed_data] - image 3.0.2 [archive meta xml] - image_picker_for_web 2.0.0 [image_picker_platform_interface meta flutter flutter_web_plugins] - image_picker_platform_interface 2.0.1 [flutter meta http plugin_platform_interface] - js 0.6.3 - json_annotation 4.0.1 - lints 1.0.1 - matcher 0.12.10 [stack_trace] - meta 1.7.0 - mime 1.0.0 - nested 1.0.0 [flutter] - octo_image 1.0.0+1 [flutter flutter_blurhash] - path 1.8.0 - path_drawing 0.5.1 [vector_math meta path_parsing flutter] - path_parsing 0.2.1 [vector_math meta] - path_provider_linux 2.0.0 [path xdg_directories path_provider_platform_interface flutter] - path_provider_macos 2.0.0 [flutter] - path_provider_platform_interface 2.0.1 [flutter meta platform plugin_platform_interface] - path_provider_windows 2.0.0 [path_provider_platform_interface meta path flutter ffi win32] - pedantic 1.11.0 - petitparser 4.1.0 [meta] - platform 3.0.0 - plugin_platform_interface 2.0.0 [meta] - process 4.2.1 [file path platform] - rxdart 0.27.1 - share_plus_linux 2.0.4 [share_plus_platform_interface file flutter meta url_launcher] - share_plus_macos 2.0.2 [share_plus_platform_interface flutter] - share_plus_platform_interface 2.0.1 [flutter meta mime plugin_platform_interface] - share_plus_web 2.0.4 [share_plus_platform_interface url_launcher flutter flutter_web_plugins meta] - share_plus_windows 2.0.3 [share_plus_platform_interface flutter meta url_launcher] - shared_preferences_linux 2.0.0 [flutter file meta path path_provider_linux shared_preferences_platform_interface] - shared_preferences_macos 2.0.0 [shared_preferences_platform_interface flutter] - shared_preferences_platform_interface 2.0.0 [flutter] - shared_preferences_web 2.0.0 [shared_preferences_platform_interface flutter flutter_web_plugins meta] - shared_preferences_windows 2.0.0 [shared_preferences_platform_interface flutter file meta path path_provider_platform_interface path_provider_windows] - sky_engine 0.0.99 - source_span 1.8.1 [collection path term_glyph] - sqflite 2.0.0+4 [flutter sqflite_common path] - sqflite_common 2.0.1 [synchronized path meta] - stack_trace 1.10.0 [path] - stream_channel 2.1.0 [async] - string_scanner 1.1.0 [charcode source_span] - synchronized 3.0.0 - term_glyph 1.2.0 - test_api 0.4.2 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph matcher] - typed_data 1.3.0 [collection] - universal_io 2.0.4 [collection crypto meta typed_data] - url_launcher_linux 2.0.1 [flutter] - url_launcher_macos 2.0.1 [flutter] - url_launcher_platform_interface 2.0.4 [flutter plugin_platform_interface] - url_launcher_web 2.0.4 [flutter flutter_web_plugins meta url_launcher_platform_interface] - url_launcher_windows 2.0.2 [flutter] - uuid 3.0.4 [crypto] - vector_math 2.1.0 - win32 2.0.4 [ffi] - xdg_directories 0.2.0 [meta path process] - xml 5.1.2 [collection meta petitparser] - yaml 3.1.0 [collection source_span string_scanner] ```