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

πŸ› [cloud_firestore_platform_interface] Attempt to invoke virtual method 'long java.lang.Long.longValue()' on a null object reference #11738

Closed shrijanRegmi closed 1 year ago

shrijanRegmi commented 1 year ago

Bug report

Describe the bug

Have been receiving Attempt to invoke virtual method 'long java.lang.Long.longValue()' on a null object reference error today on cloud_firestore get calls. On looking at the stacktrace, it's coming from cloud_firestore_platform_interface.

Screenshot 2023-10-19 at 7 40 36β€―PM

Steps to reproduce

Steps to reproduce the behavior:

  1. Call the get method on any DocumentReference

Expected behavior

The get call should return the DocumentSnapshot

Sample project

final ref = FirebaseFirestore.instance;
final documentRef = ref.collection('some_col').doc('some_doc');
final documentSnap = await documentRef.get();

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, 3.13.0, on macOS 14.0 23A344 darwin-arm64, locale en-NP) ! Warning: `flutter` on your path resolves to /Users/shrijanregmi/Projects/Flutter/sdk/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/shrijanregmi/fvm/versions/3.13.0. Consider adding /Users/shrijanregmi/fvm/versions/3.13.0/bin to the front of your path. ! Warning: `dart` on your path resolves to /opt/homebrew/Cellar/dart/2.19.6/libexec/bin/dart, which is not inside your current Flutter SDK checkout at /Users/shrijanregmi/fvm/versions/3.13.0. Consider adding /Users/shrijanregmi/fvm/versions/3.13.0/bin to the front of your path. [βœ“] Android toolchain - develop for Android devices (Android SDK version 33.0.2) [βœ“] Xcode - develop for iOS and macOS (Xcode 15.0) [βœ“] Chrome - develop for the web [βœ“] Android Studio (version 2022.2) [βœ“] VS Code (version 1.83.1) [βœ“] Connected device (3 available) [βœ“] Network resources ! Doctor found issues in 1 category. ```

Flutter dependencies

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

Click To Expand ``` Dart SDK 3.1.0 Flutter SDK 3.13.0 alp 2.1.4+340 dependencies: - adapty_flutter 2.7.0 [flutter meta] - after_layout 1.2.0 [flutter] - cached_network_image 3.3.0 [cached_network_image_platform_interface cached_network_image_web flutter flutter_cache_manager octo_image] - carousel_slider 4.2.1 [flutter] - circular_profile_avatar 2.0.5 [flutter cached_network_image] - clipboard 0.1.3 [flutter] - cloud_firestore 4.11.0 [cloud_firestore_platform_interface cloud_firestore_web collection firebase_core firebase_core_platform_interface flutter meta] - cloud_firestore_web 3.8.1 [_flutterfire_internals cloud_firestore_platform_interface collection firebase_core firebase_core_web flutter flutter_web_plugins js] - copy_with_extension 5.0.4 [meta] - country_code_picker 3.0.0 [flutter collection] - country_codes 2.2.0 [flutter] - detectable_text_field 2.1.0 [flutter] - dio 5.3.3 [async http_parser meta path] - dotted_border 2.1.0 [flutter path_drawing] - easy_debounce 2.0.3 - easy_localization 3.0.3 [flutter shared_preferences intl args path easy_logger flutter_localizations] - emoji_picker_flutter 1.6.2 [flutter flutter_web_plugins plugin_platform_interface shared_preferences] - enum_to_string 2.0.1 - expandable_text 2.3.0 [flutter] - firebase_analytics 10.6.1 [firebase_analytics_platform_interface firebase_analytics_web firebase_core firebase_core_platform_interface flutter] - firebase_analytics_web 0.5.5+3 [_flutterfire_internals firebase_analytics_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins js] - firebase_auth 4.11.1 [firebase_auth_platform_interface firebase_auth_web firebase_core firebase_core_platform_interface flutter meta] - firebase_auth_web 5.8.4 [firebase_auth_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins http_parser js meta] - firebase_core 2.19.0 [firebase_core_platform_interface firebase_core_web flutter meta] - firebase_core_web 2.8.1 [firebase_core_platform_interface flutter flutter_web_plugins js meta] - firebase_crashlytics 3.4.1 [firebase_core firebase_core_platform_interface firebase_crashlytics_platform_interface flutter stack_trace] - firebase_dynamic_links 5.4.1 [firebase_core firebase_core_platform_interface firebase_dynamic_links_platform_interface flutter meta plugin_platform_interface] - firebase_messaging 14.7.1 [firebase_core firebase_core_platform_interface firebase_messaging_platform_interface firebase_messaging_web flutter meta] - firebase_messaging_web 3.5.10 [_flutterfire_internals firebase_core firebase_core_web firebase_messaging_platform_interface flutter flutter_web_plugins js meta] - firebase_performance 0.9.3+1 [firebase_core firebase_core_platform_interface firebase_performance_platform_interface firebase_performance_web flutter] - firebase_performance_web 0.1.4+9 [_flutterfire_internals firebase_core firebase_core_web firebase_performance_platform_interface flutter flutter_web_plugins js] - firebase_storage 11.3.1 [firebase_core firebase_core_platform_interface firebase_storage_platform_interface firebase_storage_web flutter] - firebase_storage_web 3.6.10 [_flutterfire_internals async firebase_core firebase_core_web firebase_storage_platform_interface flutter flutter_web_plugins http js meta] - flex_color_picker 3.3.0 [flex_seed_scheme flutter] - flutter 0.0.0 [characters collection material_color_utilities meta vector_math web sky_engine] - flutter_isolate 2.0.4 [flutter uuid] - flutter_map 6.0.0-dev.3 [async collection flutter http latlong2 meta polylabel proj4dart vector_math] - flutter_map_animations 0.5.0-dev.1 [flutter flutter_map latlong2] - flutter_map_cancellable_tile_provider 1.0.0-preview [dio flutter flutter_map] - flutter_map_line_editor 5.0.0 [flutter latlong2 flutter_map_dragmarker] - flutter_map_location_marker 7.0.5 [flutter flutter_compass flutter_map geolocator latlong2] - flutter_map_marker_cluster 1.2.0 [flutter flutter_map flutter_map_marker_popup latlong2] - flutter_native_splash 2.3.4 [args flutter flutter_web_plugins js html image meta path universal_io xml yaml] - flutter_screenutil 5.9.0 [flutter] - flutter_slidable 3.0.0 [flutter] - flutter_speed_dial 7.0.0 [flutter] - flutter_styled_toast 2.2.1 [flutter flutter_localizations] - flutter_svg 2.0.7 [flutter vector_graphics vector_graphics_codec vector_graphics_compiler] - flutter_uxcam 2.4.6 [flutter visibility_detector] - flutter_web_plugins 0.0.0 [flutter characters collection material_color_utilities meta vector_math web] - fluttertoast 8.2.2 [flutter flutter_web_plugins] - freezed_annotation 2.4.1 [collection json_annotation meta] - geolocator 10.1.0 [flutter geolocator_platform_interface geolocator_android geolocator_apple geolocator_web geolocator_windows] - google_fonts 6.1.0 [flutter http path_provider crypto] - group_radio_button 1.3.0 [flutter] - hashtagable 2.3.0+1 [flutter] - hooks_riverpod 2.4.4 [collection flutter flutter_hooks flutter_riverpod riverpod state_notifier] - image_cropper 5.0.0 [flutter image_cropper_platform_interface image_cropper_for_web] - image_picker 1.0.4 [flutter image_picker_android image_picker_for_web image_picker_ios image_picker_linux image_picker_macos image_picker_platform_interface image_picker_windows] - image_picker_for_web 3.0.1 [flutter flutter_web_plugins image_picker_platform_interface mime] - intl 0.18.1 [clock meta path] - isar 3.1.0+1 [ffi js meta] - isar_flutter_libs 3.1.0+1 [flutter isar] - jiffy 6.2.1 [intl] - json_annotation 4.8.1 [meta] - json_serializable 6.7.1 [analyzer async build build_config collection json_annotation meta path pub_semver pubspec_parse source_gen source_helper] - map_launcher 3.0.1 [flutter] - maps_toolkit 3.0.0 - package_info_plus 4.2.0 [ffi flutter flutter_web_plugins http meta path package_info_plus_platform_interface win32] - path_provider 2.1.1 [flutter path_provider_android path_provider_foundation path_provider_linux path_provider_platform_interface path_provider_windows] - percent_indicator 4.2.3 [flutter] - provider 6.0.5 [collection flutter nested] - reorderables 0.6.0 [flutter] - responsive_framework 1.1.1 [flutter collection] - retrofit 4.0.3 [dio meta] - 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] - showcaseview 2.0.3 [flutter] - stomp_dart_client 1.0.0 [web_socket_channel] - string_validator 1.0.2 - system_settings 2.1.0 [flutter] - url_launcher 6.1.14 [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.7 [crypto] - vector_map_tiles 6.0.0 [flutter flutter_map http latlong2 path_provider vector_tile_renderer async executor_lib] - vector_tile_renderer 5.0.1 [flutter vector_tile fixnum collection] - version 3.0.2 - wiredash 1.7.5 [clock collection file flutter flutter_localizations http http_parser intl material_color_utilities path_provider shared_preferences] dev dependencies: - build_runner 2.4.6 [analyzer args async 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] - copy_with_extension_gen 5.0.4 [analyzer build source_gen copy_with_extension meta] - flutter_oss_licenses 2.0.1 [path meta yaml dart_pubspec_licenses args] - 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] - freezed 2.4.5 [analyzer build build_config collection meta source_gen freezed_annotation json_annotation] - isar_generator 3.1.0+1 [analyzer build dart_style dartx glob isar path source_gen xxh3] - mockito 5.4.2 [analyzer build code_builder collection dart_style matcher meta path source_gen test_api] - retrofit_generator 7.0.8 [analyzer build built_collection code_builder dart_style dio retrofit source_gen tuple] transitive dependencies: - _fe_analyzer_shared 61.0.0 [meta] - _flutterfire_internals 1.3.9 [collection firebase_core firebase_core_platform_interface flutter meta] - analyzer 5.13.0 [_fe_analyzer_shared collection convert crypto glob meta package_config path pub_semver source_span watcher yaml] - animated_stack_widget 0.0.4 [flutter] - archive 3.4.6 [crypto path pointycastle] - args 2.4.2 - async 2.11.0 [collection meta] - boolean_selector 2.1.1 [source_span string_scanner] - build 2.4.1 [analyzer async convert crypto glob logging meta package_config path] - build_config 1.1.1 [checked_yaml json_annotation path pubspec_parse yaml] - build_daemon 4.0.0 [built_collection built_value http_multi_server logging path pool shelf shelf_web_socket stream_transform watcher web_socket_channel] - build_resolvers 2.4.1 [analyzer async build collection convert crypto graphs logging package_config path pool pub_semver stream_transform yaml] - build_runner_core 7.2.11 [async build build_config build_resolvers collection convert crypto glob graphs json_annotation logging meta package_config path pool timing watcher yaml] - built_collection 5.1.1 - built_value 8.6.3 [built_collection collection fixnum meta] - cached_network_image_platform_interface 3.0.0 [flutter flutter_cache_manager] - cached_network_image_web 1.1.0 [cached_network_image_platform_interface flutter flutter_cache_manager] - characters 1.3.0 - checked_yaml 2.0.3 [json_annotation source_span yaml] - clock 1.1.1 - cloud_firestore_platform_interface 6.0.1 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface] - code_builder 4.7.0 [built_collection built_value collection matcher meta] - collection 1.17.2 - convert 3.1.1 [typed_data] - cross_file 0.3.3+6 [js meta] - crypto 3.0.3 [typed_data] - csslib 1.0.0 [source_span] - dart_pubspec_licenses 2.0.2 [yaml path json_annotation] - dart_style 2.3.2 [analyzer args path pub_semver source_span] - dartx 1.2.0 [characters collection crypto meta path time] - easy_logger 0.0.2 [flutter] - executor_lib 1.1.1 [flutter async] - 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.1 [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.7.3 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface] - firebase_auth_platform_interface 7.0.1 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface] - firebase_core_platform_interface 5.0.0 [collection flutter flutter_test meta plugin_platform_interface] - firebase_crashlytics_platform_interface 3.6.9 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface] - firebase_dynamic_links_platform_interface 0.2.6+9 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface] - firebase_messaging_platform_interface 4.5.10 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface] - firebase_performance_platform_interface 0.1.4+9 [_flutterfire_internals firebase_core flutter plugin_platform_interface] - firebase_storage_platform_interface 4.4.9 [collection firebase_core flutter meta plugin_platform_interface] - fixnum 1.1.0 - flex_seed_scheme 1.4.0 [collection flutter meta] - flutter_cache_manager 3.3.1 [clock collection file flutter http path path_provider rxdart sqflite uuid] - flutter_compass 0.8.0 [flutter] - flutter_hooks 0.20.3 [flutter] - flutter_localizations 0.0.0 [flutter intl characters clock collection material_color_utilities meta path vector_math web] - flutter_map_dragmarker 5.0.0 [flutter flutter_map latlong2] - flutter_map_marker_popup 5.3.0-dev.1 [flutter animated_stack_widget flutter_map latlong2 provider] - flutter_plugin_android_lifecycle 2.0.16 [flutter] - flutter_riverpod 2.4.4 [collection flutter meta riverpod state_notifier] - frontend_server_client 3.2.0 [async path] - geolocator_android 4.3.1 [flutter geolocator_platform_interface uuid] - geolocator_apple 2.3.2 [flutter geolocator_platform_interface] - geolocator_platform_interface 4.1.1 [flutter plugin_platform_interface vector_math meta] - geolocator_web 2.2.0 [flutter flutter_web_plugins geolocator_platform_interface] - geolocator_windows 0.2.1 [flutter geolocator_platform_interface] - glob 2.1.2 [async collection file path string_scanner] - graphs 2.3.1 [collection] - html 0.15.4 [csslib source_span] - http 1.1.0 [async http_parser meta] - http_multi_server 3.2.1 [async] - http_parser 4.0.2 [collection source_span string_scanner typed_data] - image 4.1.3 [archive meta xml] - image_cropper_for_web 3.0.0 [flutter flutter_web_plugins image_cropper_platform_interface js] - image_cropper_platform_interface 5.0.0 [flutter plugin_platform_interface http] - image_picker_android 0.8.8+1 [flutter flutter_plugin_android_lifecycle image_picker_platform_interface] - image_picker_ios 0.8.8+2 [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.1 [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] - io 1.0.4 [meta path string_scanner] - js 0.6.7 [meta] - latlong2 0.9.0 [intl] - lists 1.0.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.9.1 - mgrs_dart 2.0.0 [unicode] - mime 1.0.4 - nested 1.0.0 [flutter] - octo_image 2.0.0 [flutter] - package_config 2.1.0 [path] - package_info_plus_platform_interface 2.0.1 [flutter meta plugin_platform_interface] - path 1.8.3 - path_drawing 1.0.1 [vector_math meta path_parsing flutter] - path_parsing 1.0.1 [vector_math meta] - path_provider_android 2.2.0 [flutter path_provider_platform_interface] - path_provider_foundation 2.3.1 [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.1 [flutter platform plugin_platform_interface] - path_provider_windows 2.2.1 [ffi flutter path path_provider_platform_interface win32] - petitparser 5.4.0 [meta] - platform 3.1.3 - plugin_platform_interface 2.1.6 [meta] - pointycastle 3.7.3 [collection convert js] - polylabel 1.0.1 [collection] - pool 1.5.1 [async stack_trace] - proj4dart 2.1.0 [mgrs_dart wkt_parser meta] - protobuf 2.1.0 [fixnum collection meta] - pub_semver 2.1.4 [collection meta] - pubspec_parse 1.2.3 [checked_yaml collection json_annotation pub_semver yaml] - riverpod 2.4.4 [meta stack_trace state_notifier] - rxdart 0.27.7 - 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.4 [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.1 [flutter plugin_platform_interface] - shared_preferences_web 2.2.1 [flutter flutter_web_plugins shared_preferences_platform_interface] - shared_preferences_windows 2.3.2 [file flutter path path_provider_platform_interface path_provider_windows shared_preferences_platform_interface] - shelf 1.4.1 [async collection http_parser path stack_trace stream_channel] - shelf_web_socket 1.0.4 [shelf stream_channel web_socket_channel] - sky_engine 0.0.99 - source_gen 1.4.0 [analyzer async build dart_style glob path source_span yaml] - source_helper 1.3.4 [analyzer collection source_gen] - source_span 1.10.0 [collection path term_glyph] - sqflite 2.3.0 [flutter sqflite_common path] - sqflite_common 2.5.0 [synchronized path meta] - stack_trace 1.11.0 [path] - state_notifier 1.0.0 [meta] - stream_channel 2.1.1 [async] - stream_transform 2.1.0 - string_scanner 1.2.0 [source_span] - synchronized 3.1.0 - term_glyph 1.2.1 - test_api 0.6.0 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph] - time 2.1.3 [clock] - timing 1.0.1 [json_annotation] - tuple 2.0.2 - typed_data 1.3.2 [collection] - unicode 0.3.1 [lists] - universal_io 2.2.2 [collection meta typed_data] - url_launcher_android 6.1.0 [flutter url_launcher_platform_interface] - url_launcher_ios 6.1.5 [flutter url_launcher_platform_interface] - url_launcher_linux 3.0.6 [flutter url_launcher_platform_interface] - url_launcher_macos 3.0.7 [flutter url_launcher_platform_interface] - url_launcher_platform_interface 2.1.5 [flutter plugin_platform_interface] - url_launcher_web 2.0.20 [flutter flutter_web_plugins url_launcher_platform_interface] - url_launcher_windows 3.0.8 [flutter url_launcher_platform_interface] - vector_graphics 1.1.9 [flutter vector_graphics_codec] - vector_graphics_codec 1.1.9 - vector_graphics_compiler 1.1.9 [args meta path_parsing xml vector_graphics_codec path] - vector_math 2.1.4 - vector_tile 1.0.0 [fixnum protobuf] - visibility_detector 0.4.0+2 [flutter] - watcher 1.1.0 [async path] - web 0.1.4-beta - web_socket_channel 2.4.0 [async crypto stream_channel] - win32 5.0.9 [ffi] - wkt_parser 2.0.0 - xdg_directories 1.0.3 [meta path] - xml 6.3.0 [collection meta petitparser] - xxh3 1.0.1 - yaml 3.1.2 [collection source_span string_scanner] ```

darshankawar commented 1 year ago

Thanks for the report @shrijanRegmi I am unable to replicate the reported error using the plugin example and after adding the code snippet you shared that I added in the example as below:

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);

  if (shouldUseFirestoreEmulator) {
    FirebaseFirestore.instance.useFirestoreEmulator('localhost', 8080);
  }

  final ref = FirebaseFirestore.instance;
  final documentRef = ref.collection('firestore-example-app').doc('Tenet');
  final documentSnap = await documentRef.get();
  print(documentSnap);

  runApp(FirestoreExampleApp());
}

My pubspec.yaml:

environment:
  sdk: '>=3.1.0 <4.0.0'

dependencies:
  cloud_firestore: ^4.11.0
  firebase_core: ^2.19.0
  flutter:
    sdk: flutter
  http: ^0.13.3

Can you narrow down the error by providing only bare minimal code sample only using flutterfire plugins that shows the reported error ?

shrijanRegmi commented 1 year ago

Hey @darshankawar,

Looks like there is an issue with the latest plugin (but not sure which one). Downgrading all of the firebase plugins solved my problem. I'll look into this problem more carefully in the weekend and leave a comment here.

I downgraded from the below:

firebase_core: ^2.19.0
firebase_core_web: ^2.8.1
firebase_analytics: ^10.6.1
firebase_analytics_web: ^0.5.5+3
firebase_auth: ^4.11.1
firebase_auth_web: ^5.8.4
firebase_storage: ^11.3.1
firebase_storage_web: ^3.6.10
firebase_crashlytics: ^3.4.1
firebase_performance: ^0.9.3+1
firebase_performance_web: ^0.1.4+9
firebase_messaging: ^14.7.1
firebase_messaging_web: ^3.5.10
firebase_dynamic_links: ^5.4.1
cloud_firestore: ^4.11.0
cloud_firestore_web: ^3.8.1

to the below:

firebase_core: ^2.17.0
firebase_core_web: ^2.8.0
firebase_analytics: ^10.5.1
firebase_analytics_web: ^0.5.5+1
firebase_auth: ^4.10.1
firebase_auth_web: ^5.8.2
firebase_storage: ^11.2.8
firebase_storage_web: ^3.6.8
firebase_crashlytics: ^3.3.7
firebase_performance: ^0.9.2+7
firebase_performance_web: ^0.1.4+7
firebase_messaging: ^14.6.9
firebase_messaging_web: ^3.5.8
firebase_dynamic_links: ^5.3.7
cloud_firestore: ^4.9.3
cloud_firestore_web: ^3.7.2
meomap commented 1 year ago

I've just updated to firebase_core: ^2.19.0 & cloud_firestore: ^4.11.1 and got same problem. It works again after downgrading to older versions as @shrijanRegmi said

adamkoch commented 1 year ago

Same issue here with same fix as @meomap and @shrijanRegmi.

For me, the issue only seemed to show up on Android. iOS and web continued to work with the newer dependencies.

russellwheatley commented 1 year ago

It might help if you share the document for reproduction. change any sensitive data (e.g. email address), it is important you keep the types within the document the same however.

AlexFeldmeier commented 1 year ago

I've been running into the same issue with one of my firebase projects. Removing this line fixed it for me FirebaseFirestore.instance.settings = const Settings(persistenceEnabled: true);

It's enabled by default anyway according to the docs Configure offline persistence

For Android and Apple platforms, offline persistence is enabled by default. To disable persistence, set the PersistenceEnabled option to false.

I hope this helps

suhairhassan commented 1 year ago

@AlexFeldmeier you are awesome. I had the same line and if you have not provided this commented i would be still struggling. Thanks a lot πŸ‘

russellwheatley commented 1 year ago

@AlexFeldmeier - Which platform produces this behaviour?

Edit - I was able to reproduce on android.

AlexFeldmeier commented 11 months ago

@russellwheatley Sorry for the late reply. It happens in Android and iOS. Web you still need this if you want persistence

  if (kIsWeb) {
    await FirebaseFirestore.instance.enablePersistence(const PersistenceSettings(synchronizeTabs: true));
  }