cordova-plugin-firebasex: FirebasePlugin.h:4:9: fatal error: module 'FirebaseFirestore' not found
cordova: 11.0.0 cordova-ios: 6.2.0 cordova-plugin-firebasex: 14.1.0 (also tried 14.1.0-cli) xcode: 13.4
Error:
In file included from /Users/< user >/< project >/cordova/platforms/ios/< app name >/Plugins/cordova-plugin-firebasex/AppDelegate+FirebasePlugin.m:2: /Users/< user >/< project >/cordova/platforms/ios/< app name >/Plugins/cordova-plugin-firebasex/FirebasePlugin.h:4:9: fatal error: module ‘FirebaseFirestore’ not found @import FirebaseFirestore;
Tried the following but didn’t fix it:
pod repo updatethenpod installin the platforms/ios dirpod deintegrateandpod installcordova platform rm/add ioscordova plugin rm/add cordova-plugin-firebasexcordova clean- Xcode clean build folder
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 5
- Comments: 30 (4 by maintainers)
I have seen the same issue, I resolve it by manually changing Podfile to force download Firestore. Below is my step to resolve it:
pod 'FirebaseFirestore', :tag => '9.1.0', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git'bypod 'Firebase/Firestore', '9.1.0'pod installI think the issue occurs because
pod 'FirebaseFirestore', :tag => '9.1.0', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.gitdoes not contains FirebaseFirestore moduleSorry for my bad English
cordova-plugin-firebasex@14.2.0has just been published to npm and should resolve this. By default, the plugin will now use the standard pod for Firestore unless you optionally specify the plugin variableIOS_USE_PRECOMPILED_FIRESTORE_POD=trueat install time, in which case the pre-compiled version will be used.If you have issues with an existing project, run these commands from
platforms/ios/as suggested here:Note that in the version you can also specify
IOS_FIREBASE_SDK_VERSIONto override the version of the Firebase iOS SDK pinned inplugin.xml.So… some progress here, this seems to be tied to the iOS deployment target for the FirebaseFirestore being
iOS 10.0. If I go into the cordova workspace file and manually bump JUST this dependency toiOS 11.0, then this all builds correctly:I’ll update if I get a better way to set this automatically…
@aliexalter This plugin (as noted) relies on Cordova Hook scripts to configure the native platform projects. Ionic Appflow does not support all of the hooks used by this plugin so it may not work correctly in that build environment.
I’m using intel and I’m running into this error when trying to archive from Xcode, I’ll update if I find something (using this plugin on the latest version)
Just to clarify previous comments/suggestions - I’m still doing my builds on an Intel-based mbp and it’s throwing the “Module ‘FirebaseFirestore’ not found” error when I try to analyze the app. I’m able to build it, and even run it on my local device. But I can’t get it uploaded to the app store as it won’t pass basic checks.
Ran into same issue. Went back to cordova-plugin-firebasex: 14.0.0 and seems to compile in xcode.
Not the prettiest… but here’s a cordova hook that does the job for me:
Added to
iosplatform inconfig.xml:In a file in
hooks/firebaseDeploymentTargetFix.jsin the root of your cordova project:How many hours do people spend trying to correct this issue? Is it worth of 15 minutes of compilation on some old PC? https://github.com/dpa99c/cordova-plugin-firebasex/pull/737#issuecomment-1141884263
Seems like this issue might be specific to Apple Silicon: https://github.com/invertase/firestore-ios-sdk-frameworks/issues/51
The reason for not using the Firestore Pod directly from the Firebase SDK is that it needs to be compiled from scratch which can take a very long time - upwards of 30 minutes on an old Mac: https://github.com/dpa99c/cordova-plugin-firebasex/issues/407
This was resolved by using a git repo which contains a pre-compiled version of Firestore which significantly decreases build time: https://github.com/dpa99c/cordova-plugin-firebasex/pull/440
But it seems from the issue raised against
firestore-ios-sdk-frameworksthere might be a problem with this on Apple Silicon. Hence running in Rosetta resolves it as it will handle code compiled for Intel architecture.