Closed neatnoin closed 2 years ago
@neatnoin
There's not enough details provided except the logs. Are there any more logs that you can provide ?
Is there any description or entry in the log that says something like NSNULL -
?
Are there any steps to replicate or reproducible code sample you can provide involving sub collection document query
?
If it happened first, app can't build because of same crash. And I'm using query statement like this
QuerySnapshot<Map<String, dynamic>> userQuery = await FirebaseFirestore
.instance
.collection(COLLECTION_USERS)
.limit(1)
.where(KEY_STATUS, isEqualTo: 'DONE')
.where(KEY_GENDER,
isEqualTo: currentUser.gender == '여자' ? '남자' : '여자')
.orderBy(KEY_INDEX)
.where(KEY_INDEX,
whereNotIn:
matchedUserListIndex.toList())
.where(KEY_INDEX, isGreaterThanOrEqualTo: randomNumber)
.get();
Only one document is matched with this condition There's error message in Xcode
@neatnoin Check this issue comment and see if it helps.
I fixed this issue. It was an error cause by using FieldValue.arrayUnion() at not growable FieldValue List.
FirebaseFirestore.instance .collection(COLLECTIONUSERS) .doc(currentUser.userKey) .collection('MATCHING') .doc('${currentDate.year}-${currentDate.month}-${currentDate.day}') .update({ 'userKey': FieldValue.arrayUnion(matchedList), ...Map.fromIterable(matchedList, key: (v) => v, value: () => ['', '']) });
Thanks a lot.
Closing this as resolved.
Bug report
Steps to reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Sample project
Providing a minimal example project which demonstrates the bug in isolation from your main App greatly enhances the chance of a timely fix. Please link to the public repository URL.
Additional context
Add any other context about the problem here.
Flutter doctor
Run
flutter doctor
and paste the output below:Click To Expand
[✓] Flutter (Channel stable, 2.5.2, on macOS 12.0.1 21A559 darwin-x64, locale ko-KR) • Flutter version 2.5.2 at /Users/nis/Documents/Developer/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 3595343e20 (9 weeks ago), 2021-09-30 12:58:18 -0700 • Engine revision 6ac856380f • Dart version 2.14.3 [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3) • Android SDK at /Users/nis/Library/Android/sdk • Platform android-30, build-tools 30.0.3 • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 13.1, Build version 13A1030d • CocoaPods version 1.10.1 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 4.1) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495) [✓] VS Code (version 1.54.1) • VS Code at /Users/nis/Downloads/Visual Studio Code.app/Contents • Flutter extension can be installed from: 🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter [✓] Connected device (2 available) • iPhone 13 (mobile) • 069ECD14-A9A9-4EDF-ADAC-AE3C80F877DB • ios • com.apple.CoreSimulator.SimRuntime.iOS-15-0 (simulator) • Chrome (web) • chrome • web-javascript • Google Chrome 96.0.4664.55Flutter dependencies
Run
flutter pub deps -- --style=compact
and paste the output below:Click To Expand
get: ^4.3.8 provider: ^6.0.1 path_provider: ^2.0.5 path: ^1.8.0 font_awesome_flutter: ^9.1.0 rxdart: ^0.27.2 firebase_core: ^1.10.0 firebase_auth: ^3.2.0 cloud_firestore: ^3.1.0 cloud_functions: ^3.1.1 firebase_storage: ^10.1.0 image_picker: ^0.8.4+2 image_cropper: ^1.4.1 cached_network_image: ^3.1.0 permission_handler: ^8.2.2 app_settings: ^4.1.1 pin_code_fields: ^7.3.0 equatable: ^2.0.3 contacts_service: ^0.6.3