invertase / firestore-ios-sdk-frameworks

⚡ Precompiled Firestore iOS SDKs extracted from the Firebase iOS SDK repository release downloads for faster build times.
Apache License 2.0
430 stars 48 forks source link

Build fails on macOS #26

Closed lukaszciastko closed 3 years ago

lukaszciastko commented 3 years ago

I can successfully use the precompiled Firestore framework on iOS, however, on macOS, the build fails with errors:

Launching lib/main.dart on macOS in debug mode...
 lib/main.dart
/Users/*/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_functions-0.9.0/macos/Classes/FLTFirebaseFunctionsPlugin.m:85:16: warning: 'useFunctionsEmulatorOrigin:' is deprecated: Use useEmulator(host:port:) instead. [-Wdeprecated-declarations]
    [functions useFunctionsEmulatorOrigin:origin];
               ^
In module 'FirebaseFunctions' imported from /Users/*/Projects/*/*/macos/Pods/Headers/Public/Firebase/Firebase.h:56:
/Users/*/Projects/*/*/macos/Pods/FirebaseFunctions/Functions/FirebaseFunctions/Public/FirebaseFunctions/FIRFunctions.h:90:24: note: 'useFunctionsEmulatorOrigin:' has been explicitly marked deprecated here
        __attribute__((deprecated("Use useEmulator(host:port:) instead.")));
                       ^
1 warning generated.
In file included from /Users/*/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.16.0+1/macos/Classes/FLTQuerySnapshotStreamHandler.m:8:
/Users/*/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.16.0+1/macos/Classes/Private/FLTFirebaseFirestoreUtils.h:42:4: error: expected a type
+ (FIRFirestoreSource)FIRFirestoreSourceFromArguments:(NSDictionary *_Nonnull)arguments;

   ^
/Users/*/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.16.0+1/macos/Classes/Private/FLTFirebaseFirestoreUtils.h:44:4: error: expected a type
+ (FIRFirestore *_Nullable)getCachedFIRFirestoreInstanceForKey:(NSString *_Nonnull)key;

   ^
/Users/*/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.16.0+1/macos/Classes/Private/FLTFirebaseFirestoreUtils.h:45:40: error: expected a type
+ (void)setCachedFIRFirestoreInstance:(FIRFirestore *_Nonnull)firestore

                                       ^
/Users/*/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.16.0+1/macos/Classes/FLTQuerySnapshotStreamHandler.m:12:33: error: no type or protocol named 'FIRListenerRegistration'

@property(readwrite, strong) id<FIRListenerRegistration> listenerRegistration;
                                ^
/Users/*/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.16.0+1/macos/Classes/FLTQuerySnapshotStreamHandler.m:19:3: error: use of undeclared identifier 'FIRQuery'
  FIRQuery *query = arguments[@"query"];
  ^
/Users/*/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.16.0+1/macos/Classes/FLTQuerySnapshotStreamHandler.m:19:13: error: use of undeclared identifier 'query'
  FIRQuery *query = arguments[@"query"];
            ^
/Users/*/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.16.0+1/macos/Classes/FLTQuerySnapshotStreamHandler.m:21:7: error: use of undeclared identifier 'query'
  if (query == nil) {
      ^
/Users/*/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.16.0+1/macos/Classes/FLTQuerySnapshotStreamHandler.m:31:19: error: type-id cannot have a name
  id listener = ^(FIRQuerySnapshot *_Nullable snapshot, NSError *_Nullable error) {
                  ^~~~~~~~~~~~~~~~
/Users/*/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.16.0+1/macos/Classes/FLTQuerySnapshotStreamHandler.m:31:36: error: expected ')'
  id listener = ^(FIRQuerySnapshot *_Nullable snapshot, NSError *_Nullable error) {
                                   ^
/Users/*/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.16.0+1/macos/Classes/FLTQuerySnapshotStreamHandler.m:31:18: note: to match this '('
  id listener = ^(FIRQuerySnapshot *_Nullable snapshot, NSError *_Nullable error) {
                 ^
/Users/*/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.16.0+1/macos/Classes/FLTQuerySnapshotStreamHandler.m:31:17: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
  id listener = ^(FIRQuerySnapshot *_Nullable snapshot, NSError *_Nullable error) {
                ^
/Users/*/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.16.0+1/macos/Classes/FLTQuerySnapshotStreamHandler.m:32:9: error: use of undeclared identifier 'error'
    if (error) {
        ^
/Users/*/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.16.0+1/macos/Classes/FLTQuerySnapshotStreamHandler.m:33:91: error: use of undeclared identifier 'error'
      NSArray *codeAndMessage = [FLTFirebaseFirestoreUtils ErrorCodeAndMessageFromNSError:error];
                                                                                          ^
/Users/*/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.16.0+1/macos/Classes/FLTQuerySnapshotStreamHandler.m:44:62: error: use of undeclared identifier 'error'
                                          andOptionalNSError:error]);

                                                             ^
/Users/*/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.16.0+1/macos/Classes/FLTQuerySnapshotStreamHandler.m:48:16: error: use of undeclared identifier 'snapshot'
        events(snapshot);
               ^

/Users/*/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.16.0+1/macos/Classes/FLTQuerySnapshotStreamHandler.m:54:8: error: use of undeclared identifier 'query'
      [query addSnapshotListenerWithIncludeMetadataChanges:includeMetadataChanges.boolValue

       ^
/Users/*/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.16.0+1/macos/Classes/FLTQuerySnapshotStreamHandler.m:61:30: error: no known instance method for selector 'remove'
  [self.listenerRegistration remove];
                             ^~~~~~
1 warning and 15 errors generated.
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
** BUILD FAILED **

Exception: Build process failed
Exited (sigterm)

Inside my Podfile, I have:

pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '7.3.0'

And my pubspec:

  firebase_core: ^0.7.0
  firebase_auth: ^0.20.1
  cloud_firestore: ^0.16.0+1
  cloud_functions: ^0.9.0
mikehardy commented 3 years ago

Per comments on #11 I think you just need to move to 7.4.0 or later. Per the release notes 7.6.0 is current

Then it should "Just Work(tm)" ?

mikehardy commented 3 years ago

To be clear - just in case - you have to move your entire app to the new version, not just this framework (confusion has happened about that before). However, 7.x.x releases have no breaking changes so it should be just a version override in your Podfile and done, with the version name the one expected here https://github.com/FirebaseExtended/flutterfire/blob/060bc7bb73987f5fed3ceaf70c41451058bb4ad9/packages/firebase_core/firebase_core/ios/firebase_core.podspec#L6-L8