Slow builds, whether locally or in the CI, reduce developer productivity. If you integrated Firestore into your Flutter app, you might have experienced slow build times in your apps.
There have been issues that outline the slow build times developers experience when Firestore is added as a dependency:
- [cloud_firestore] Xcode build extremely slow #349
- Adding FirebaseFirestore pod dependency adds minutes to build time #4284
These issues affect the speed of getting out builds to testers and users, and it's also expensive to pay for macOS CI machines on the cloud.
Use pre-compiled Firestore iOS SDK
The issue is caused by the 500k+ lines of mostly C++, which gets compiled as part of the Xcode build process and takes a long time.
The precompiled Firestore iOS SDK solves this problem. It includes
xcframework files extracted from the Firebase iOS SDK repository are released and tagged using the Firebase iOS SDK versions.
Find your Firebase iOS SDK version
cloud_firestore dependency, check for the Firebase SDK version in the
9.2.0 is the Firebase SDK version of this project.
See supported versions for the precompiled Firestore iOS SDK.
Update your Podfile
ios/Podfile, reference the precompiled Firestore iOS SDK git repository inside your
flutter packages get.
It's a wrap
My tests showed that using the precompiled iOS SDK for Firestore reduced 67% of iOS my project's build time in the CI.
|Build #||Old build time||New build time|
See the runs at flutter_firebase_precompiled_sdk
Give it a try, and let me know what your build times are at email@example.com 👋