找不到Firebase Xcode导入cloud_firestore

时间:2020-06-12 18:55:21

标签: android xcode firebase flutter google-cloud-firestore

你好,我是第一次使用Firebase,但是当我运行程序时,出现此错误,有人知道什么可能是错的吗?

(“Oláeu estou firebase pela primeira vez,mas quando eu executar o meu programa me este erroalguémsabe o que pode estar errado?”

主要错误:未找到cloud_firestore

已更改的错误:

Xcode's output:
↳
    /Users/indumonta/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-0.2.5+1/ios/Classes/FirebaseCorePlugin.m:13:17: warning: property 'dictionary' requires method 'dictionary' to be defined - use @dynamic or provide a method implementation in this category [-Wobjc-property-implementation]
    @implementation FIROptions (FLTFirebaseCorePlugin)
                    ^
    /Users/indumonta/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-0.2.5+1/ios/Classes/FirebaseCorePlugin.m:10:46: note: property declared here
    @property(readonly, nonatomic) NSDictionary *dictionary;
                                                 ^
    1 warning generated.
    /Users/indumonta/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.6.3/ios/Classes/CloudFirestorePlugin.m:351:26: error: unknown receiver 'FIRSetOptions'; did you mean 'FIROptions'?
                    options:[FIRSetOptions merge]
                             ^~~~~~~~~~~~~
                             FIROptions
    In module 'FirebaseCore' imported from /Users/indumonta/AndroidStudioProjects/firebase/ios/Pods/Headers/Public/Firebase/Firebase.h:15:
    /Users/indumonta/AndroidStudioProjects/firebase/ios/Pods/FirebaseCore/FirebaseCore/Sources/Public/FIROptions.h:25:12: note: 'FIROptions' declared here
    @interface FIROptions : NSObject <NSCopying>
               ^
    /Users/indumonta/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.6.3/ios/Classes/CloudFirestorePlugin.m:351:40: error: no known class method for selector 'merge'
                    options:[FIRSetOptions merge]
                                           ^~~~~
    /Users/indumonta/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.6.3/ios/Classes/CloudFirestorePlugin.m:350:17: error: no visible @interface for 'FIRDocumentReference' declares the selector 'setData:options:completion:'
          [document setData:call.arguments[@"data"]
           ~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Users/indumonta/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.6.3/ios/Classes/CloudFirestorePlugin.m:440:76: error: unknown receiver 'FIRSetOptions'; did you mean 'FIROptions'?
          [batch setData:call.arguments[@"data"] forDocument:document options:[FIRSetOptions merge]];
                                                                               ^~~~~~~~~~~~~
                                                                               FIROptions
    In module 'FirebaseCore' imported from /Users/indumonta/AndroidStudioProjects/firebase/ios/Pods/Headers/Public/Firebase/Firebase.h:15:
    /Users/indumonta/AndroidStudioProjects/firebase/ios/Pods/FirebaseCore/FirebaseCore/Sources/Public/FIROptions.h:25:12: note: 'FIROptions' declared here
    @interface FIROptions : NSObject <NSCopying>
               ^
    /Users/indumonta/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.6.3/ios/Classes/CloudFirestorePlugin.m:440:90: error: no known class method for selector 'merge'
          [batch setData:call.arguments[@"data"] forDocument:document options:[FIRSetOptions merge]];
                                                                                             ^~~~~
    /Users/indumonta/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.6.3/ios/Classes/CloudFirestorePlugin.m:440:14: error: no visible @interface for 'FIRWriteBatch' declares the selector 'setData:forDocument:options:'
          [batch setData:call.arguments[@"data"] forDocument:document options:[FIRSetOptions merge]];
           ~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Users/indumonta/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.6.3/ios/Classes/CloudFirestorePlugin.m:270:7: warning: block implicitly retains 'self'; explicitly mention 'self' to indicate this is intended behavior [-Wimplicit-retain-self]
          transactions[transactionId] = transaction;
          ^
          self->
    /Users/indumonta/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.6.3/ios/Classes/CloudFirestorePlugin.m:277:29: warning: block implicitly retains 'self'; explicitly mention 'self' to indicate this is intended behavior [-Wimplicit-retain-self]
                                transactionResults[transactionId] = doTransactionResult;
                                ^
                                self->
    /Users/indumonta/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.6.3/ios/Classes/CloudFirestorePlugin.m:284:14: warning: block implicitly retains 'self'; explicitly mention 'self' to indicate this is intended behavior [-Wimplicit-retain-self]
          return transactionResults[transactionId];
                 ^
                 self->
    /Users/indumonta/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.6.3/ios/Classes/CloudFirestorePlugin.m:298:37: warning: block implicitly retains 'self'; explicitly mention 'self' to indicate this is intended behavior [-Wimplicit-retain-self]
          FIRTransaction *transaction = transactions[transactionId];
                                        ^
                                        self->
    /Users/indumonta/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.6.3/ios/Classes/CloudFirestorePlugin.m:322:37: warning: block implicitly retains 'self'; explicitly mention 'self' to indicate this is intended behavior [-Wimplicit-retain-self]
          FIRTransaction *transaction = transactions[transactionId];
                                        ^
                                        self->
    /Users/indumonta/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.6.3/ios/Classes/CloudFirestorePlugin.m:331:37: warning: block implicitly retains 'self'; explicitly mention 'self' to indicate this is intended behavior [-Wimplicit-retain-self]
          FIRTransaction *transaction = transactions[transactionId];
                                        ^
                                        self->
    /Users/indumonta/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.6.3/ios/Classes/CloudFirestorePlugin.m:340:37: warning: block implicitly retains 'self'; explicitly mention 'self' to indicate this is intended behavior [-Wimplicit-retain-self]
          FIRTransaction *transaction = transactions[transactionId];
                                        ^
                                        self->
    10 warnings and 6 errors generated.
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description
Could not build the application for the simulator.
Error launching application on iPhone 11.

2 个答案:

答案 0 :(得分:0)

在终端中运行以下命令:

flutter clean

然后:

flutter build ios

答案 1 :(得分:0)

转到根文件夹中的ios目录并运行pod install,此问题将得到解决 如果它告诉您pod无法识别或运行brew install ruby