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

🐛 [cloud_firestore] FLTFirebasePlugin.m +[FLTFirebasePlugin createFlutterErrorFromCode:message:optionalDetails:andOptionalNSError:] #6821

Closed Tom3652 closed 3 years ago

Tom3652 commented 3 years ago

Bug report

Describe the bug

My application has crashed because of this on my real device iphone 12 pro max in IOS 14.7.1 The logs are coming from crashlytics. I believe this is from Firestore according to the logs.

Steps to reproduce

I have no idea how to reproduce this as i haven't identify the pattern yet. So it is quite hard to know which query is causing this as i a have a lot... EDIT : It already happened 5 times.

Expected behavior

The application should not crash.

Additional context

Here are the logs from crashlytics :

Crashed: com.apple.root.default-qos
0  CoreFoundation                 0x18bac9f68 CFHash.cold.1 + 16
1  CoreFoundation                 0x18b9d372c CFHash + 588
2  CoreFoundation                 0x18ba7fe80 CFBasicHashFindBucket + 232
3  CoreFoundation                 0x18b998654 CFDictionaryGetValue + 220
4  CoreFoundation                 0x18b99bcc0 CFErrorCopyCallBackBlockForDomain + 68
5  CoreFoundation                 0x18b99aec8 _CFErrorCopyUserInfoKeyFromCallBack + 36
6  CoreFoundation                 0x18b99ab6c _CFErrorCreateLocalizedDescription + 104
7  Foundation                     0x18cd0f550 -[NSError localizedDescription] + 88
8  Runner                         0x102660dc8 +[FLTFirebasePlugin createFlutterErrorFromCode:message:optionalDetails:andOptionalNSError:] + 35 (FLTFirebasePlugin.m:35)
9  Runner                         0x10264c920 __54-[FLTFirebaseFirestorePlugin handleMethodCall:result:]_block_invoke + 179 (FLTFirebaseFirestorePlugin.m:179)
10 Runner                         0x10264d5b8 __66-[FLTFirebaseFirestorePlugin transactionGet:withMethodCallResult:]_block_invoke + 351 (FLTFirebaseFirestorePlugin.m:351)
11 libdispatch.dylib              0x18b641a84 _dispatch_call_block_and_release + 32
12 libdispatch.dylib              0x18b64381c _dispatch_client_callout + 20
13 libdispatch.dylib              0x18b646968 _dispatch_queue_override_invoke + 756
14 libdispatch.dylib              0x18b654fe0 _dispatch_root_queue_drain + 388
15 libdispatch.dylib              0x18b6557d8 _dispatch_worker_thread2 + 112
16 libsystem_pthread.dylib        0x1d77e2768 _pthread_wqthread + 216
17 libsystem_pthread.dylib        0x1d77e974c start_wqthread + 8 

In the other logs inside the StackTrace it is mentioned 5 times :

com.google.firebase.firestore.transaction
0  libsystem_kernel.dylib         0x1b9d36550 semaphore_timedwait_trap + 8
1  libdispatch.dylib              0x18b643e00 _dispatch_sema4_timedwait + 64
2  libdispatch.dylib              0x18b644410 _dispatch_semaphore_wait_slow + 76
3  Runner                         0x1026530e4 __63-[FLTTransactionStreamHandler onListenWithArguments:eventSink:]_block_invoke + 52 (FLTTransactionStreamHandler.m:52)
4  FirebaseFirestore              0x104e009f8 ___ZZ65-[FIRFirestore runTransactionWithBlock:dispatchQueue:completion:]EN17TransactionResult14RunUpdateBlockENSt3__110shared_ptrIN8firebase9firestore4core11TransactionEEENS0_8functionIFvNS3_4util6StatusEEEE_block_invoke + 188
5  libdispatch.dylib              0x18b641a84 _dispatch_call_block_and_release + 32
6  libdispatch.dylib              0x18b64381c _dispatch_client_callout + 20
7  libdispatch.dylib              0x18b646cf4 _dispatch_continuation_pop + 448
8  libdispatch.dylib              0x18b646384 _dispatch_async_redirect_invoke + 592
9  libdispatch.dylib              0x18b654fe0 _dispatch_root_queue_drain + 388
10 libdispatch.dylib              0x18b6557d8 _dispatch_worker_thread2 + 112
11 libsystem_pthread.dylib        0x1d77e2768 _pthread_wqthread + 216
12 libsystem_pthread.dylib        0x1d77e974c start_wqthread + 8

So it may be related to transactions. I may give everything else i have got from crashlytics if needed.


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.2.3, on macOS 11.5.2 20G95 darwin-x64, locale fr-FR) [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3) [✓] Xcode - develop for iOS and macOS [✓] Chrome - develop for the web [!] Android Studio (version 2020.3) ✗ Unable to find bundled Java version. [✓] Connected device (3 available) ! Doctor found issues in 1 category. ```

Flutter dependencies

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

Click To Expand ``` Dart SDK 2.13.4 Flutter SDK 2.2.3 myappname 1.0.0+1 dependencies: - app_tracking_transparency 2.0.1 [flutter] - badges 2.0.1 [flutter] - better_player 0.0.72 [flutter cupertino_icons wakelock pedantic meta flutter_widget_from_html_core visibility_detector path_provider collection xml] - cached_network_image 3.1.0 [flutter flutter_cache_manager octo_image cached_network_image_platform_interface cached_network_image_web] - camera 0.8.1+7 [camera_platform_interface flutter pedantic quiver] - circular_menu 1.2.3 [flutter] - clipboard 0.1.3 [flutter] - cloud_firestore 2.4.0 [cloud_firestore_platform_interface cloud_firestore_web firebase_core firebase_core_platform_interface flutter meta] - cloud_functions 3.0.0 [cloud_functions_platform_interface cloud_functions_web firebase_core firebase_core_platform_interface flutter] - connectivity 3.0.6 [flutter meta connectivity_platform_interface connectivity_macos connectivity_for_web] - country_code_picker 2.0.2 [flutter modal_bottom_sheet collection universal_platform] - crypto 3.0.1 [collection typed_data] - cupertino_back_gesture 0.1.0 [flutter] - cupertino_icons 1.0.3 - extended_image 4.1.0 [extended_image_library flutter meta] - extended_tabs 2.3.0 [flutter] - firebase_analytics 8.2.0 [firebase_analytics_platform_interface firebase_analytics_web firebase_core flutter meta] - firebase_auth 3.0.1 [firebase_auth_platform_interface firebase_auth_web firebase_core firebase_core_platform_interface flutter meta] - firebase_core 1.4.0 [firebase_core_platform_interface firebase_core_web flutter meta] - firebase_crashlytics 2.1.1 [firebase_core firebase_core_platform_interface firebase_crashlytics_platform_interface flutter stack_trace] - firebase_database 7.1.2 [firebase_core flutter] - firebase_dynamic_links 2.0.7 [firebase_core flutter] - firebase_in_app_messaging 0.5.0+7 [firebase_core flutter meta] - firebase_messaging 10.0.4 [firebase_core firebase_core_platform_interface firebase_messaging_platform_interface firebase_messaging_web flutter meta] - firebase_performance 0.7.0+7 [firebase_core flutter] - firebase_storage 10.0.1 [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_app_badger 1.2.0 [flutter] - flutter_arc_text 0.5.0 [characters flutter] - flutter_cache_manager 3.1.2 [clock collection file flutter http path path_provider pedantic rxdart sqflite uuid] - flutter_contacts 1.1.0+3 [flutter] - flutter_facebook_auth 3.5.0 [flutter flutter_facebook_auth_platform_interface flutter_facebook_auth_web] - flutter_ffmpeg 0.4.2 [flutter] - flutter_image_compress 1.1.0 [flutter] - flutter_local_notifications 8.1.1+1 [flutter flutter_local_notifications_platform_interface platform timezone] - flutter_localizations 0.0.0 [flutter intl characters clock collection meta path typed_data vector_math] - flutter_sound_lite 8.3.9 [path_provider recase uuid provider flutter_spinkit path synchronized logger flutter flutter_sound_platform_interface flutter_sound_web] - flutter_staggered_grid_view 0.4.0 [flutter] - flutter_svg 0.22.0 [flutter meta path_drawing vector_math xml] - fluttertoast 8.0.8 [flutter flutter_web_plugins] - geocoding 2.0.0 [flutter geocoding_platform_interface] - geolocator 7.4.0 [flutter geolocator_platform_interface geolocator_android geolocator_apple geolocator_web] - google_maps_flutter 2.0.6 [flutter flutter_plugin_android_lifecycle google_maps_flutter_platform_interface] - google_mobile_ads 0.13.3 [meta flutter] - google_sign_in 5.0.7 [flutter google_sign_in_platform_interface google_sign_in_web meta] - image_editor 1.0.0 [flutter] - in_app_review 2.0.2 [flutter in_app_review_platform_interface] - intl 0.17.0 [clock path] - light_compressor 1.1.1 [flutter] - modal_bottom_sheet 2.0.0 [flutter] - path 1.8.0 - path_provider 2.0.2 [flutter path_provider_platform_interface path_provider_macos path_provider_linux path_provider_windows] - permission_handler 8.1.4+2 [flutter meta permission_handler_platform_interface] - photo_manager 1.3.1 [flutter] - progressive_image 2.0.0 [flutter] - provider 5.0.0 [collection flutter nested] - pull_to_refresh 2.0.0 [flutter] - rive 0.7.28 [collection flutter graphs http meta] - scroll_to_index 2.0.0 [flutter] - scrollable_positioned_list 0.2.0-nullsafety.0 [flutter collection] - 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.6 [meta flutter shared_preferences_platform_interface shared_preferences_linux shared_preferences_macos shared_preferences_web shared_preferences_windows] - sign_in_with_apple 3.0.0 [flutter meta] - sliver_tools 0.2.5 [flutter] - translator 0.1.7 [http] - url_launcher 6.0.9 [flutter meta url_launcher_linux url_launcher_macos url_launcher_platform_interface url_launcher_web url_launcher_windows] - uuid 3.0.4 [crypto] - video_player 2.1.13 [flutter flutter_test meta video_player_platform_interface video_player_web] - visibility_detector 0.2.0 [flutter] - volume_watcher 2.0.1 [flutter] - webview_flutter 2.0.12 [flutter] dev dependencies: - 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: - async 2.6.1 [meta collection] - 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] - camera_platform_interface 2.1.0 [cross_file flutter meta plugin_platform_interface stream_transform] - characters 1.1.0 - charcode 1.2.0 - clock 1.1.0 - cloud_firestore_platform_interface 5.3.0 [collection firebase_core flutter meta plugin_platform_interface] - cloud_firestore_web 2.3.0 [cloud_firestore_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins js] - cloud_functions_platform_interface 5.0.8 [firebase_core flutter meta plugin_platform_interface] - cloud_functions_web 4.0.10 [cloud_functions_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins js] - collection 1.15.0 - connectivity_for_web 0.4.0 [connectivity_platform_interface flutter_web_plugins flutter] - connectivity_macos 0.2.0 [flutter] - connectivity_platform_interface 2.0.1 [flutter meta plugin_platform_interface] - cross_file 0.3.1+4 [flutter meta] - csslib 0.17.0 [source_span] - extended_image_library 3.1.0 [crypto flutter http_client_helper path path_provider] - fake_async 1.2.0 [clock collection] - ffi 1.1.2 - file 6.1.2 [meta path] - firebase 9.0.1 [http http_parser js] - firebase_analytics_platform_interface 2.0.1 [flutter meta] - firebase_analytics_web 0.3.0+1 [firebase firebase_analytics_platform_interface flutter flutter_web_plugins meta] - firebase_auth_platform_interface 6.0.0 [firebase_core flutter meta plugin_platform_interface] - firebase_auth_web 3.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.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.0 [collection firebase_core flutter meta plugin_platform_interface] - firebase_messaging_platform_interface 3.0.3 [firebase_core flutter meta plugin_platform_interface] - firebase_messaging_web 2.0.3 [firebase_core firebase_core_web firebase_messaging_platform_interface flutter flutter_web_plugins js meta] - firebase_storage_platform_interface 4.0.0 [collection firebase_core flutter meta plugin_platform_interface] - firebase_storage_web 3.0.0 [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_facebook_auth_platform_interface 2.7.0 [flutter plugin_platform_interface] - flutter_facebook_auth_web 2.6.0+2 [flutter flutter_web_plugins js flutter_facebook_auth_platform_interface] - flutter_local_notifications_platform_interface 4.0.1 [flutter plugin_platform_interface] - flutter_plugin_android_lifecycle 2.0.2 [flutter] - flutter_sound_platform_interface 8.3.9 [flutter meta plugin_platform_interface logger] - flutter_sound_web 8.3.9 [flutter_sound_platform_interface flutter logger flutter_web_plugins meta js] - flutter_spinkit 5.0.0 [flutter] - flutter_web_plugins 0.0.0 [flutter js characters collection meta typed_data vector_math] - flutter_widget_from_html_core 0.6.2 [csslib flutter html] - geocoding_platform_interface 2.0.0 [flutter meta plugin_platform_interface] - geolocator_android 1.0.0 [flutter geolocator_platform_interface] - geolocator_apple 1.0.0 [flutter geolocator_platform_interface] - geolocator_platform_interface 2.3.2 [flutter plugin_platform_interface vector_math meta] - geolocator_web 2.0.6 [flutter flutter_web_plugins geolocator_platform_interface] - google_maps_flutter_platform_interface 2.1.1 [collection flutter meta plugin_platform_interface stream_transform] - google_sign_in_platform_interface 2.0.1 [flutter meta quiver] - google_sign_in_web 0.10.0+1 [flutter flutter_web_plugins google_sign_in_platform_interface js meta] - graphs 2.0.0 - html 0.15.0 [csslib source_span] - http 0.13.3 [async http_parser meta path pedantic] - http_client_helper 2.0.2 [http] - http_parser 4.0.0 [charcode collection source_span string_scanner typed_data] - in_app_review_platform_interface 2.0.2 [flutter url_launcher plugin_platform_interface platform] - js 0.6.3 - logger 1.0.0 - matcher 0.12.10 [stack_trace] - meta 1.3.0 - mime 1.0.0 - nested 1.0.0 [flutter] - octo_image 1.0.0+1 [flutter flutter_blurhash] - path_drawing 0.5.1 [vector_math meta path_parsing flutter] - path_parsing 0.2.1 [vector_math meta] - path_provider_linux 2.0.2 [flutter path path_provider_platform_interface xdg_directories] - path_provider_macos 2.0.2 [flutter] - path_provider_platform_interface 2.0.1 [flutter meta platform plugin_platform_interface] - path_provider_windows 2.0.3 [ffi flutter meta path path_provider_platform_interface win32] - pedantic 1.11.1 - permission_handler_platform_interface 3.6.1 [flutter meta plugin_platform_interface] - petitparser 4.1.0 [meta] - platform 3.0.0 - plugin_platform_interface 2.0.1 [meta] - process 4.2.3 [file path platform] - quiver 3.0.1 [matcher] - recase 4.0.0 - rxdart 0.27.1 - share_plus_linux 2.0.3 [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.2 [file meta flutter path path_provider_linux shared_preferences_platform_interface] - shared_preferences_macos 2.0.2 [flutter shared_preferences_platform_interface] - shared_preferences_platform_interface 2.0.0 [flutter] - shared_preferences_web 2.0.1 [flutter flutter_web_plugins meta shared_preferences_platform_interface] - shared_preferences_windows 2.0.2 [flutter file meta path path_provider_platform_interface path_provider_windows shared_preferences_platform_interface] - sky_engine 0.0.99 - source_span 1.8.1 [collection path term_glyph] - sqflite 2.0.0+3 [flutter sqflite_common path] - sqflite_common 2.0.0+2 [synchronized path meta] - 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 - term_glyph 1.2.0 - test_api 0.3.0 [async boolean_selector collection meta path source_span stack_trace stream_channel string_scanner term_glyph matcher] - timezone 0.7.0 [path] - typed_data 1.3.0 [collection] - universal_platform 1.0.0+1 - 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.2 [flutter flutter_web_plugins meta url_launcher_platform_interface] - url_launcher_windows 2.0.1 [flutter] - vector_math 2.1.0 - video_player_platform_interface 4.1.0 [flutter meta flutter_test] - video_player_web 2.0.2 [flutter flutter_web_plugins meta video_player_platform_interface] - wakelock 0.5.3+3 [flutter meta wakelock_macos wakelock_platform_interface wakelock_web wakelock_windows] - wakelock_macos 0.1.0+2 [flutter flutter_web_plugins wakelock_platform_interface] - wakelock_platform_interface 0.2.1+2 [flutter meta] - wakelock_web 0.2.0+2 [flutter flutter_web_plugins js wakelock_platform_interface] - wakelock_windows 0.1.0+1 [flutter wakelock_platform_interface win32] - win32 2.2.5 [ffi] - xdg_directories 0.2.0 [meta path process] - xml 5.1.2 [collection meta petitparser] ```

Tom3652 commented 3 years ago

I am adding a new crash that came up only now from crashlytics and may be related too :

Fatal Exception: NSInvalidArgumentException
0  CoreFoundation                 0x18ba56708 __exceptionPreprocess
1  libobjc.A.dylib                0x1a05607a8 objc_exception_throw
2  CoreFoundation                 0x18b959bfc -[NSOrderedSet initWithSet:copyItems:]
3  CoreFoundation                 0x18ba59260 ___forwarding___
4  CoreFoundation                 0x18ba5b560 _CF_forwarding_prep_0
5  Runner                         0x104766840 -[FLTFirebaseFirestorePlugin queryGet:withMethodCallResult:] + 471 (FLTFirebaseFirestorePlugin.m:471)
6  Runner                         0x104764cdc -[FLTFirebaseFirestorePlugin handleMethodCall:result:] + 226 (FLTFirebaseFirestorePlugin.m:226)
7  Flutter                        0x108b4ce44 (Missing)
8  Flutter                        0x10885f690 (Missing)
9  Flutter                        0x108b661a8 (Missing)
10 Flutter                        0x108b01f78 (Missing)
11 Flutter                        0x108b03df8 (Missing)
12 CoreFoundation                 0x18b9d11d4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__
13 CoreFoundation                 0x18b9d0dd0 __CFRunLoopDoTimer
14 CoreFoundation                 0x18b9d0220 __CFRunLoopDoTimers
15 CoreFoundation                 0x18b9c9fd4 __CFRunLoopRun
16 CoreFoundation                 0x18b9c9308 CFRunLoopRunSpecific
17 GraphicsServices               0x1a304c734 GSEventRunModal
18 UIKitCore                      0x18e44775c -[UIApplication _run]
19 UIKitCore                      0x18e44cfcc UIApplicationMain
20 Runner                         0x104142c08 main + 6 (AppDelegate.swift:6)
21 libdyld.dylib                  0x18b685cf8 start

I have no clue what could be causing this...

markusaksli-nc commented 3 years ago

Since you don't know what exactly is causing this I'm going to label this based on the report for now.

russellwheatley commented 3 years ago

Hey @Tom3652, the first port of call would be to update to the latest cloud_firestore which is version 2.5.1. You're currently using 2.4.0 which does not have this change. Firebase iOS SDK is also updated in the latest release. Looking at the release notes, it doesn't suggest a bug fix in Firestore, but worth the update nonetheless.

Tom3652 commented 3 years ago

Hi @russellwheatley thanks for your answer. Yes you are probably right because i always use the latest version of all Firebase plugins. So i am already using the latest 2.5.1 and i haven't seen this issue since then, with more or less the same code in my app :)

russellwheatley commented 3 years ago

That's great! I'm going to close this issue for now, if it crops up again, I will reopen 👍

LucaJeevanjee commented 3 years ago

Hey everyone, I am currently getting this issue consistently with my latest builds on iOS. App launches and then crashes on every try. I have attempted to uninstall and reinstall but it does not help. My previous version still works fine when I roll back in Testflight but I cannot figure out where this error is suddenly coming from.

Fatal Exception: NSInvalidArgumentException
0  CoreFoundation                 0x18507e708 __exceptionPreprocess
1  libobjc.A.dylib                0x199b887a8 objc_exception_throw
2  CoreFoundation                 0x184f81bfc -[NSOrderedSet initWithSet:copyItems:]
3  CoreFoundation                 0x185081260 ___forwarding___
4  CoreFoundation                 0x185083560 _CF_forwarding_prep_0
5  Roots                          0x100261b34 -[FLTQuerySnapshotStreamHandler onListenWithArguments:eventSink:] + 54 (FLTQuerySnapshotStreamHandler.m:54)
6  Flutter                        0x1054e538c (Missing)
7  Flutter                        0x1051f7690 (Missing)
8  Flutter                        0x1054fe1a8 (Missing)
9  Flutter                        0x105499f78 (Missing)
10 Flutter                        0x10549bdf8 (Missing)
11 CoreFoundation                 0x184ff91d4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__
12 CoreFoundation                 0x184ff8dd0 __CFRunLoopDoTimer
13 CoreFoundation                 0x184ff8220 __CFRunLoopDoTimers
14 CoreFoundation                 0x184ff1fd4 __CFRunLoopRun
15 CoreFoundation                 0x184ff1308 CFRunLoopRunSpecific
16 GraphicsServices               0x19c674734 GSEventRunModal
17 UIKitCore                      0x187a6f75c -[UIApplication _run]
18 UIKitCore                      0x187a74fcc UIApplicationMain
19 Roots                          0x1002570e0 main + 9 (AppDelegate.swift:9)
20 libdyld.dylib                  0x184cadcf8 start
com.google.firebase.firestore.transaction
0  libsystem_kernel.dylib         0x1b3244550 semaphore_timedwait_trap + 8
1  libdispatch.dylib              0x184c6be00 _dispatch_sema4_timedwait + 64
2  libdispatch.dylib              0x184c6c410 _dispatch_semaphore_wait_slow + 76
3  Roots                          0x100262524 __63-[FLTTransactionStreamHandler onListenWithArguments:eventSink:]_block_invoke + 52 (FLTTransactionStreamHandler.m:52)
4  FirebaseFirestore              0x102a716a8 ___ZZ65-[FIRFirestore runTransactionWithBlock:dispatchQueue:completion:]EN17TransactionResult14RunUpdateBlockENSt3__110shared_ptrIN8firebase9firestore4core11TransactionEEENS0_8functionIFvNS3_4util6StatusEEEE_block_invoke + 188
5  libdispatch.dylib              0x184c69a84 _dispatch_call_block_and_release + 32
6  libdispatch.dylib              0x184c6b81c _dispatch_client_callout + 20
7  libdispatch.dylib              0x184c6ecf4 _dispatch_continuation_pop + 448
8  libdispatch.dylib              0x184c6e384 _dispatch_async_redirect_invoke + 592
9  libdispatch.dylib              0x184c7cfe0 _dispatch_root_queue_drain + 388
10 libdispatch.dylib              0x184c7d7d8 _dispatch_worker_thread2 + 112
11 libsystem_pthread.dylib        0x1d0cee768 _pthread_wqthread + 216
12 libsystem_pthread.dylib        0x1d0cf574c start_wqthread + 8
NSOperationQueue 0x139d2ba90 (QOS: UNSPECIFIED)
0  libsystem_kernel.dylib         0x1b32690cc __psynch_cvwait + 8
1  libsystem_pthread.dylib        0x1d0cf0434 _pthread_cond_wait + 1248
2  Foundation                     0x186361398 -[NSOperation waitUntilFinished] + 584
3  Foundation                     0x18640bccc __NSOPERATIONQUEUE_IS_WAITING_ON_AN_OPERATION__ + 24
4  Foundation                     0x186314f54 -[NSOperationQueue waitUntilAllOperationsAreFinished] + 224
5  VirgilSDK                      0x103b18d1c $s9VirgilSDK16GenericOperationC9startSync7timeouts6ResultOyxs5Error_pGSdSg_tF + 1068
6  VirgilSDK                      0x103afd238 $s9VirgilSDK10CardClientC11searchCards10identitiesSayAA14RawSignedModelCGSaySSG_tKF + 972
7  VirgilSDK                      0x103afd3b0 $s9VirgilSDK10CardClientC11searchCards10identitiesSayAA14RawSignedModelCGSaySSG_tKFTo + 96
8  VirgilSDK                      0x103b04590 $s9VirgilSDK11CardManagerC11searchCards10identitiesAA16GenericOperationCySayAA0C0CGGSaySSG_tFyAA08CallbackI0CyAJG_yAJSg_s5Error_pSgtctcfU_ + 112
9  VirgilSDK                      0x103b01db8 $s9VirgilSDK17CallbackOperationCyAA4CardCGAESgs5Error_pSgIeggg_Ieggg_AFxSgAIlyAEIsegng_Ieggg_TRTm + 96
10 VirgilSDK                      0x103afa9c0 $s9VirgilSDK17CallbackOperationC4mainyyF + 104
11 VirgilSDK                      0x103afac70 $s9VirgilSDK17CallbackOperationC4mainyyFTo + 24
12 VirgilSDK                      0x103af5d08 $s9VirgilSDK14AsyncOperationC5startyyFTo + 28
13 Foundation                     0x18640de54 __NSOPERATIONQUEUE_IS_STARTING_AN_OPERATION__ + 24
14 Foundation                     0x18640d8e0 __NSOQSchedule_f + 184
15 libdispatch.dylib              0x184c7a484 _dispatch_block_async_invoke2 + 148
16 libdispatch.dylib              0x184c6b81c _dispatch_client_callout + 20
17 libdispatch.dylib              0x184c6ecf4 _dispatch_continuation_pop + 448
18 libdispatch.dylib              0x184c6e384 _dispatch_async_redirect_invoke + 592
19 libdispatch.dylib              0x184c7cfe0 _dispatch_root_queue_drain + 388
20 libdispatch.dylib              0x184c7d7d8 _dispatch_worker_thread2 + 112
21 libsystem_pthread.dylib        0x1d0cee768 _pthread_wqthread + 216
22 libsystem_pthread.dylib        0x1d0cf574c start_wqthread + 8
com.google.firebase.firestore.rpc
0  libsystem_kernel.dylib         0x1b326b9bc poll + 8
1  grpc                           0x10471c088 pollset_work(grpc_pollset*, grpc_pollset_worker**, long long) + 1152
2  grpc                           0x10471df48 pollset_work(grpc_pollset*, grpc_pollset_worker**, long long) + 72
3  grpc                           0x104710268 cq_next(grpc_completion_queue*, gpr_timespec, void*) + 516
4  grpcpp                         0x104a9ae78 grpc_impl::CompletionQueue::AsyncNextInternal(void**, bool*, gpr_timespec) + 60
5  FirebaseFirestore              0x102a2ca84 firebase::firestore::remote::Datastore::PollGrpcQueue() + 104
6  FirebaseFirestore              0x102b17a6c firebase::firestore::util::Task::ExecuteAndRelease() + 184
7  libdispatch.dylib              0x184c6b81c _dispatch_client_callout + 20
8  libdispatch.dylib              0x184c73004 _dispatch_lane_serial_drain + 620
9  libdispatch.dylib              0x184c73c00 _dispatch_lane_invoke + 404
10 libdispatch.dylib              0x184c7e4bc _dispatch_workloop_worker_thread + 764
11 libsystem_pthread.dylib        0x1d0cee7a4 _pthread_wqthread + 276
12 libsystem_pthread.dylib        0x1d0cf574c start_wqthread + 8

These are some of my logs... The app does navigate the first few pages: Splash => InApp Splash => Root => TabManager (crashes here)

Below are the versions of the firebase dependencies in my pubspec.yaml

firebase_core: ^1.6.0
cloud_firestore: ^2.5.1fi
firebase_auth: ^3.1.0
firebase_storage: ^10.0.3
firebase_messaging: ^10.0.6
cloud_functions: ^3.0.2
paginate_firestore: ^1.0.2
firebase_crashlytics: ^2.2.1
firebase_dynamic_links: ^2.0.2
Tom3652 commented 3 years ago

It seems to be related to the issue i have added in my comment.

It is written NSInvalidArgumentException so i have wondered if i was using a null object as a Query parameter but i was not or i have not found it out yet...

If this always crash in your latest app version, it should be easier to track your changes and identify better the problem until maybe provide a reproductible code sample (that i was not able to provide) :/

LucaJeevanjee commented 3 years ago

It seems to be related to the issue i have added in my comment.

It is written NSInvalidArgumentException so i have wondered if i was using a null object as a Query parameter but i was not or i have not found it out yet...

If this always crash in your latest app version, it should be easier to track your changes and identify better the problem until maybe provide a reproductible code sample (that i was not able to provide) :/

Yes I have figured out that it was because I was passing in a null value in a firestore query. After setting this as an empty array by default, the error no longer happened.

However I think this issue needs to be fixed as passing a non valid argument should not cause a fatal crash and should instead pass an exception or just return an empty value.

Tom3652 commented 3 years ago

It was the same in my case i was using some variable taken from SharedPreferences and pass it as an argument, finally figured.

I agree with you this should not crash though.

russellwheatley commented 3 years ago

Hey @LucaJeevanjee, do you mind pasting your query exactly so I can reproduce? I agree, we should catch this error before it becomes a fatal crash.

LucaJeevanjee commented 3 years ago

No problem

_dB.collection('posts').where('authorId', whereIn: NULL VALUE WAS HERE).orderBy('timestamp').snapshots()

It seems that the error is primarily with arrays in queries.

russellwheatley commented 3 years ago

I just tried this code:

FirebaseFirestore
.instance
.collection('flutter-tests')
.where('authorId', whereIn: null)
.orderBy('timestamp')
.snapshots()
.listen((event) {
  print('Called');
});

It works fine. To be expected as null values are handled in the query here. Anymore detail to reproduce, @LucaJeevanjee?

LucaJeevanjee commented 3 years ago

I just tried this code:

FirebaseFirestore
.instance
.collection('flutter-tests')
.where('authorId', whereIn: null)
.orderBy('timestamp')
.snapshots()
.listen((event) {
  print('Called');
});

It works fine. To be expected as null values are handled in the query here. Anymore detail to reproduce, @LucaJeevanjee?

What conditions did you test this in? For me this only breaks in release mode on iOS

russellwheatley commented 3 years ago

Debug mode. Even in release mode, that would never pass through as a parameter. Are you sure it isn't something else?

russellwheatley commented 3 years ago

I'm going to close this duplicate issue and direct anyone with the same problem to the other issue you've created here: https://github.com/FirebaseExtended/flutterfire/issues/6900

LucaJeevanjee commented 3 years ago

Nope, this is the only thing I can think of. When I changed it, my app instantly stopped crashing. Could potentially be the latest firebase sdk on IOS.