When you're building Flutter apps with Firebase Firestore, you might notice that it takes a long time to compile on iOS, especially when you run your app from scratch. This can really slow down your development process.
Good News!
The good news is that there's a straightforward solution provided by Invertase.
The Fix
To speed things up, you need to make a small change in your iOS project files.
Open the Podfile
Go to the ios
folder in your Flutter project and open the Podfile
file. This file manages the native libraries your iOS app uses.
Add a Special Pod
Inside the section for your app's target (usually named 'Runner'), add the following line:
...
target 'Runner' do
use_frameworks!
use_modular_headers!
# ADD THIS
pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '11.2.0'
end
...
Important: Match the Version
The :tag => '11.2.0'
part is crucial. You must change 11.2.0
to match the exact version of the firebase_core
or cloud_firestore
package you are using in your Flutter project's pubspec.yaml
file. Using the wrong version can cause issues.
This simple addition tells your iOS project to use pre-built frameworks for Firestore, significantly reducing compile time.