-
-
Notifications
You must be signed in to change notification settings - Fork 472
Home
- The official Firestore Pod depends on some 500k lines of mostly C++, which can lead to very long build times (e.g.see #794)
- Therefore this plugin offers the option to use a pre-built binary version of the Firestore Pod to reduce build times.
- This option can be enabled by specifying the
IOS_USE_PRECOMPILED_FIRESTORE_POD
plugin variable at plugin installation time (see plugin variables).- e.g.
cordova plugin add cordova-plugin-firebasex --variable IOS_USE_PRECOMPILED_FIRESTORE_POD=true
- This is a post-install plugin variable so has some additional requirements.
- e.g.
- If you enable this option, you MUST also ensure the environment variable
SKIP_FIREBASE_FIRESTORE_SWIFT
is set globally to a truthy value- Otherwise the build will fail (see e.g. #782)
- e.g. If using zsh:
echo 'export SKIP_FIREBASE_FIRESTORE_SWIFT=1' >> ~/.zshrc && source ~/.zshrc
- This ensures the pre-built pod is compatible with the Cordova project environment
If you encounter build failures or run-time crashes immediately after starting the app after enabling or changing the pre-build Pod setting try the following:
- Remove and re-add both the plugin and iOS plaform:
cordova platform rm ios --nosave
cordova plugin rm cordova-plugin-firebasex --nosave
cordova plugin add cordova-plugin-firebasex --nosave
cordova platform add ios --nosave
cordova prepare ios
- Resolve Cocopods issues
cd platforms/ios/
pod repo update
pod deintegrate
pod setup
pod install
- Open the Xcode project in
platforms/ios/
and clean the build folder:
Click on the Product menu while holding down the Option (Alt) key and choose Clean build folder
- Clear derived data
rm -Rf ~/Library/Developer/Xcode/DerivedData/
The deployment target must be specified in config.xml
and match that which is specified by the version of the Firebase iOS SDK the plugin is using, otherwise this can cause app crashes.
If you didn't specify a version of the Firebase iOS SDK using the IOS_FIREBASE_SDK_VERSION
, see the plugin's plugin.xml
for the default version.
Then find the deployment version for that version of the Firebase iOS SDK.
For example, for v11.4.2, look here: https://github.com/CocoaPods/Specs/blob/master/Specs/0/3/5/Firebase/11.4.2/Firebase.podspec.json
Look through platforms.ios
for the various components and find the highest value:
"platforms": {
"ios": "13.0"
}
So for Firebase iOS SDK v11.4.2, the deployment target is 13.0, so in config.xml
we must set:
<platform name="ios">
<preference name="deployment-target" value="13.0"/>
</platform>
Run cordova prepare ios
to apply the change but if you encounter issues, remove and re-add the iOS platform:
cordova platform rm ios --nosave && cordova platform add ios --nosave