Closed cybex-dev closed 1 year ago
Just a hunch, I wonder if this is related to the zip distribution of firebase-ios-sdk (which this pre-compiled framework distribution is based on) having a minimum deployment target of iOS 11, vs the previous 10.
It looks pretty similar, and if it was working with Firestore integrated "normally" (that is, not with this repo integrated) then that's the only real difference right now
Just a hunch, I wonder if this is related to the zip distribution of firebase-ios-sdk (which this pre-compiled framework distribution is based on) having a minimum deployment target of iOS 11, vs the previous 10.
56
It looks pretty similar, and if it was working with Firestore integrated "normally" (that is, not with this repo integrated) then that's the only real difference right now
Hmm, so this is my Podfile
. Note the platform is set to '13.0'.
# Uncomment this line to define a global platform for your project
platform :ios, '13.0'
...
target 'Runner' do
pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '9.3.0'
...
@mikehardy consider this issue resolved and a possible duplicate.
TL;DR: Ensure Update firebase_core and either flutterfire_ui (provider of firestore, auth & database) OR cloud_firestore is up to date.
Reduced build times, from around +6min to ~3 min.
Podfile
platform :ios, '13.0'
...
target 'Runner' do
pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '9.5.0-1'
...
pubspec.yaml
...
# Core Firebase options
firebase_core: ^1.22.0
# Used with firebase_core providing FirebaseOptions in initialization
flutterfire_ui: ^0.4.3+8
...
Note that 9.6.0 is out as of yesterday, and fixes a firestore CPU consumption bug on 9.5.0. There were not other breaking changes or anything so it should be safe to substitute directly, and will make your users happy (by using less CPU on their devices...)
Glad your build is working either way though, good luck with your project!
Hmm, check this out.
Just gave 9.6.0
a try, there might be a problem with firebase_core
's Firebase SDK version i.e. outdated?
Latest firebase_core
's
# https://firebase.google.com/support/release-notes/ios
def firebase_sdk_version!()
'9.5.0'
end
See: feat: Bump Firebase iOS SDK to 9.5.0
Note the version, it will be referenced later (in error output)
pubspec.yaml
...
# Core Firebase options
firebase_core: ^1.22.0
cloud_firestore: ^3.4.7
firebase_database: ^9.1.4
firebase_auth: ^3.8.0
...
Podfile
platform :ios, '13.0'
...
target 'Runner' do
pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '9.6.0'
...
(from existing project)
9.6.0
(see above)flutter clean && flutter pub get
cd ios && pod install --repo-update
mac@Macs-MacBook-Pro ios % pod install
Analyzing dependencies
Pre-downloading: `FirebaseFirestore` from `https://github.com/invertase/firestore-ios-sdk-frameworks.git`, tag `9.6.0`
cloud_firestore: Using Firebase SDK version '9.5.0' defined in 'firebase_core'
cloud_functions: Using Firebase SDK version '9.5.0' defined in 'firebase_core'
firebase_auth: Using Firebase SDK version '9.5.0' defined in 'firebase_core'
firebase_core: Using Firebase SDK version '9.5.0' defined in 'firebase_core'
firebase_database: Using Firebase SDK version '9.5.0' defined in 'firebase_core'
firebase_messaging: Using Firebase SDK version '9.5.0' defined in 'firebase_core'
firebase_storage: Using Firebase SDK version '9.5.0' defined in 'firebase_core'
[!] CocoaPods could not find compatible versions for pod "FirebaseFirestore":
In Podfile:
FirebaseFirestore (from `https://github.com/invertase/firestore-ios-sdk-frameworks.git`, tag `9.6.0`)
cloud_firestore (from `.symlinks/plugins/cloud_firestore/ios`) was resolved to 3.4.7, which depends on
Firebase/Firestore (= 9.5.0) was resolved to 9.5.0, which depends on
FirebaseFirestore (~> 9.5.0)
mac@Macs-MacBook-Pro ios %
For now, I'll use 9.5.0-1
- last working version.
You need to override it I think https://firebase.flutter.dev/docs/manual-installation#iosmacos
You need to override it I think https://firebase.flutter.dev/docs/manual-installation#iosmacos
Perfect, updated Podfile
file with
# Uncomment this line to define a global platform for your project
platform :ios, '13.0'
# Override Firebase SDK Version
$FirebaseSDKVersion = '9.6.0'
...
Should this be considered a temporary fix until firebase_core
is updated to reflect this new version?
Yep, an override is always just until core is updated. If you haven't logged an issue for them to update yet or there isn't one already, might be good to do so in order to subscribe to it so you know to unpin the version later as they resolve/ merge an update
PR in progress, I collaborated on it over there, nothing more actionable here and I know you're subscribed there so I think we're all good. Cheers!
As we know, Firestore takes a while to compile for XCode/iOS. For this reason, I attempted to solution: [Update] Cloud Firestore Xcode Build Times
TL;DR Add the
pod...
line to Runner PodfileNote: I've had to change mine to 9.3.0 (see output below)
XCode: 13.3.1
Flutter Doctor
``` flutter doctor -v [✓] Flutter (Channel stable, 3.0.5, on macOS 12.4 21F79 darwin-x64, locale en-ZA) • Flutter version 3.0.5 at /Applications/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision f1875d570e (9 weeks ago), 2022-07-13 11:24:16 -0700 • Engine revision e85ea0e79c • Dart version 2.17.6 • DevTools version 2.12.2 Checking Android licenses is taking an unexpectedly long time...[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3) • Android SDK at /Users/mac/Library/Android/sdk • Platform android-32, build-tools 30.0.3 • Java binary at: /Users/mac/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/212.5712.43.2112.8815526/Android Studio.app/Contents/jre/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840) • All Android licenses accepted. [!] Xcode - develop for iOS and macOS (Xcode 13.3.1) • Xcode at /Applications/Xcode.app/Contents/Developer ! CocoaPods 1.10.1 out of date (1.11.0 is recommended). CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side. Without CocoaPods, plugins will not work on iOS or macOS. For more info, see https://flutter.dev/platform-plugins To upgrade see https://guides.cocoapods.org/using/getting-started.html#installation for instructions. [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 2021.2) • Android Studio at /Users/mac/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/212.5712.43.2112.8815526/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 11.0.12+0-b1504.28-7817840) [✓] Android Studio (version 2020.3) • Android Studio at /Users/mac/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/203.7935034/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 11.0.10+0-b96-7281165) [✓] IntelliJ IDEA Ultimate Edition (version 2021.3) • IntelliJ at /Users/mac/Applications/JetBrains Toolbox/IntelliJ IDEA Ultimate.app • 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 [✓] IntelliJ IDEA Ultimate Edition (version 2021.3) • IntelliJ at /Users/mac/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/213.5744.223/IntelliJ IDEA.app • 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 [✓] IntelliJ IDEA Ultimate Edition (version 2020.3.2) • IntelliJ at /Users/mac/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/203.7148.57/IntelliJ IDEA.app • 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 [✓] VS Code (version 1.64.2) • VS Code at /Users/mac/Downloads/Visual Studio Code.app/Contents • Flutter extension can be installed from: 🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter [✓] Connected device (4 available) • Charles’s iPhone (white) (mobile) • c264836ff1973fd348162a06320665d8ddc18709 • ios • iOS 15.5 19F77 • Charles’s iPhone (black) (mobile) • 49e43e75c23a6199ac3f463bdc14a07d154d4d5e • ios • iOS 15.5 19F77 • macOS (desktop) • macos • darwin-x64 • macOS 12.4 21F79 darwin-x64 • Chrome (web) • chrome • web-javascript • Google Chrome 105.0.5195.125 ! Error: Charles’s iPhone (white) is busy: Fetching debug symbols for Charles’s iPhone (white). Xcode will continue when Charles’s iPhone (white) is finished. (code -10) ! Error: Charles’s iPhone (black) is busy: Fetching debug symbols for Charles’s iPhone (black). Xcode will continue when Charles’s iPhone (black) is finished. (code -10) [✓] HTTP Host Availability • All required HTTP hosts are available ! Doctor found issues in 1 category. ```Project pubspec dependencies
``` flutter: sdk: flutter flutter_localizations: sdk: flutter ... # Core Firebase options firebase_core: ^1.19.2 # Used with firebase_core providing FirebaseOptions in initialization flutterfire_ui: ^0.4.2+3 ... # Provides storage interface for uploading resources firebase_storage: ^10.3.3 ... # Access Firestore Cloud functions cloud_functions: ^3.3.6 ... # Provides notification mechanism for FCM/APN messages firebase_messaging: ^13.0.1 ```Steps: (intermediate integration during development)
Podfile
contentrm Podfile.lock
pod install --repo-update
Success.
Time to run
XCode compile errors (see image):
Compile Errors
``` In file included from /Users/mac/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-3.4.3/ios/Classes/FLTLoadBundleStreamHandler.m:11: /Users/mac/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-3.4.3/ios/Classes/Private/FLTFirebaseFirestoreUtils.h:43:4: error: expected a type + (FIRFirestoreSource)FIRFirestoreSourceFromArguments:(NSDictionary *_Nonnull)arguments; ^ /Users/mac/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-3.4.3/ios/Classes/Private/FLTFirebaseFirestoreUtils.h:45:4: error: expected a type + (FIRFirestore *_Nullable)getCachedFIRFirestoreInstanceForKey:(NSString *_Nonnull)key; ^ /Users/mac/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-3.4.3/ios/Classes/Private/FLTFirebaseFirestoreUtils.h:46:40: error: expected a type + (void)setCachedFIRFirestoreInstance:(FIRFirestore *_Nonnull)firestore ^ /Users/mac/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-3.4.3/ios/Classes/FLTLoadBundleStreamHandler.m:15:30: error: unknown type name 'FIRLoadBundleTask' @property(readwrite, strong) FIRLoadBundleTask *task; ^ /Users/mac/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-3.4.3/ios/Classes/FLTLoadBundleStreamHandler.m:15:1: error: property with 'retain (or strong)' attribute must be of object type @property(readwrite, strong) FIRLoadBundleTask *task; ^ /Users/mac/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-3.4.3/ios/Classes/FLTLoadBundleStreamHandler.m:23:3: error: use of undeclared identifier 'FIRFirestore' FIRFirestore *firestore = arguments[@"firestore"]; ^ /Users/mac/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-3.4.3/ios/Classes/FLTLoadBundleStreamHandler.m:23:17: error: use of undeclared identifier 'firestore' FIRFirestore *firestore = arguments[@"firestore"]; ^ /Users/mac/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-3.4.3/ios/Classes/FLTLoadBundleStreamHandler.m:26:16: error: use of undeclared identifier 'firestore' self.task = [firestore ^ /Users/mac/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-3.4.3/ios/Classes/FLTLoadBundleStreamHandler.m:48:28: error: type-id cannot have a name [self.task addObserver:^(FIRLoadBundleTaskProgress *_Nullable progress) { ^~~~~~~~~~~~~~~~~~~~~~~~~ /Users/mac/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-3.4.3/ios/Classes/FLTLoadBundleStreamHandler.m:48:54: error: expected ')' [self.task addObserver:^(FIRLoadBundleTaskProgress *_Nullable progress) { ^ /Users/mac/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-3.4.3/ios/Classes/FLTLoadBundleStreamHandler.m:48:27: note: to match this '(' [self.task addObserver:^(FIRLoadBundleTaskProgress *_Nullable progress) { ^ /Users/mac/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-3.4.3/ios/Classes/FLTLoadBundleStreamHandler.m:48:26: warning: type specifier missing, defaults to 'int' [-Wimplicit-int] [self.task addObserver:^(FIRLoadBundleTaskProgress *_Nullable progress) { ^ /Users/mac/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-3.4.3/ios/Classes/FLTLoadBundleStreamHandler.m:50:11: error: use of undeclared identifier 'progress' if (progress.state != FIRLoadBundleTaskStateError) { ^ /Users/mac/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-3.4.3/ios/Classes/FLTLoadBundleStreamHandler.m:50:29: error: use of undeclared identifier 'FIRLoadBundleTaskStateError' if (progress.state != FIRLoadBundleTaskStateError) { ^ /Users/mac/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-3.4.3/ios/Classes/FLTLoadBundleStreamHandler.m:51:16: error: use of undeclared identifier 'progress' events(progress); ^ /Users/mac/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-3.4.3/ios/Classes/FLTLoadBundleStreamHandler.m:48:4: error: bad receiver type 'int *' [self.task addObserver:^(FIRLoadBundleTaskProgress *_Nullable progress) { ^~~~~~~~~ /Users/mac/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-3.4.3/ios/Classes/FLTLoadBundleStreamHandler.m:60:4: error: bad receiver type 'int *' [self.task removeAllObservers]; ^~~~~~~~~ 1 warning and 15 errors generated. ```Changing to version (from
Podfile
) from9.3.0
to .e.g9.5.0
or9.6.0
results in the errors below, confirming I have to use9.3.0
Adding:
Results in:
Changing to
9.3.0
results in the following output (apologies for the additional packages):Adding
Results in:
Is this an issue on my side?
Feel free to request additional information - I'd like to assist resolving this issue ASAP.