Flutter使用cloud_firestore在iOS模拟器上给出错误

时间:2019-01-03 09:19:45

标签: flutter google-cloud-firestore flutter-dependencies

这是我第一次尝试与Flutter一起使用Firebase cloud_firestore。它与Android模拟器配合正常。但是尝试在IOS Sim上运行时出现以下错误:

/Users/carsoncarbery/development/tools/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.8.2+3/ios/Classes/CloudFirestorePlugin.m:50:22: error: no visible @interface for 'FIRQuery' declares the selector 'queryWhereField:arrayContains:'
query = [query queryWhereField:fieldName arrayContains:value];
~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/carsoncarbery/development/tools/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.8.2+3/ios/Classes/CloudFirestorePlugin.m:221:29: error: no known class method for selector 'fieldValueForArrayUnion:'
return [FIRFieldValue fieldValueForArrayUnion:[self readValue]];
^~~~~~~~~~~~~~~~~~~~~~~
/Users/carsoncarbery/development/tools/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.8.2+3/ios/Classes/CloudFirestorePlugin.m:224:29: error: no known class method for selector 'fieldValueForArrayRemove:'
return [FIRFieldValue fieldValueForArrayRemove:[self readValue]];
^~~~~~~~~~~~~~~~~~~~~~~~
8 warnings and 3 errors generated.
Could not build the application for the simulator.
Error launching application on iPhone 6s.

我也尝试过直接从Xcode运行Runner并得到同样的三个构建错误。不幸的是,我还没有找到答案,所以发布了这个问题。任何帮助将不胜感激。 谢谢

1 个答案:

答案 0 :(得分:0)

我刚刚经历了同样的事情。 跟随这些家伙 https://github.com/flutter/flutter/issues/24395

我做到了

pod update Firebase/Firestore

对我有用。 我正在使用最新版本的Cloud Firestore:0.9.0 + 1 我可以从Xcode和VS Code进行编译。 在模拟器上运行时,会有很多警告消息。其中一些看起来很讨厌,但是可以。