using latest version 11.0.1 I get the following exception when trying to build a release :
cordova run ios --device --release
exception :
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_FIRFirestore", referenced from:
objc-class-ref in AppDelegate+FirebasePlugin.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Steps to reproduce:
cordova run ios --device --release
Environment information
cordova -v
10.0.0
npm -v
6.14.6
node -v
v12.18.4
cordova platform ls
Installed platforms:
ios 6.1.1
cordova plugin ls
cordova-admob-sdk 0.24.1 "AdMob SDK"
cordova-android-firebase-gradle-release 2.1.0 "cordova-android-firebase-gradle-release"
cordova-android-play-services-gradle-release 2.1.0 "cordova-android-play-services-gradle-release"
cordova-android-support-gradle-release 3.0.1 "cordova-android-support-gradle-release"
cordova-custom-config 5.1.0 "cordova-custom-config"
cordova-plugin-admob-free 0.27.0 "Cordova AdMob Plugin"
cordova-plugin-apprate 1.4.0 "AppRate"
cordova-plugin-compat 1.2.0 "Compat"
cordova-plugin-dialogs 1.3.4 "Notification"
cordova-plugin-facebook4 6.4.0 "Facebook Connect"
cordova-plugin-firebasex 11.0.1 "Google Firebase Plugin"
cordova-plugin-geolocation 2.4.3 "Geolocation"
cordova-plugin-globalization 1.11.0 "Globalization"
cordova-plugin-inappbrowser 4.0.0 "InAppBrowser"
cordova-plugin-nativestorage 2.3.2 "NativeStorage"
cordova-plugin-splashscreen 4.0.3 "Splashscreen"
cordova-plugin-whitelist 1.3.4 "Whitelist"
cordova-plugin-x-socialsharing 5.6.4 "SocialSharing"
cordova-promise-polyfill 0.0.2 "cordova-promise-polyfill"
cordova-webintent 2.0.0 "cordova-webintent"
cordova.plugins.diagnostic 3.9.2 "Diagnostic"
es6-promise-plugin 4.2.2 "Promise"
xcode 12.0
macbook Pro OS 2020 Catalina
Please build the example project to validate your development environment.
If you encounter problems building the example project, ensure your Cocoapods installation is present and up to date. See the documentation for more details.
@dpa99c I get the same exact error with the example project. I am using
gem which cocoapods
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods.rb
all other deps are mentions in my first message, anything else I can provide? pretty stuck with this
This indicates a problem with your build environment - did you run "pod repo update"?
@dpa99c I've just ran pod repo update and pod update inside the platform/ios folder, cleaned the build folder and rebuild -> same issue.
I'm unable to reproduce this issue in a release build - both CLI and Xcode release builds work fine for me with both the example project and various production projects in which I use this plugin.
See this console output for a successful CLI release build of the example project.
Googling the error message you're encountering, it seems from this SO post that a missing $(inherited) value in the "Other Linker Flags" section of the Xcode projects' Build Settings can cause this.
This plugin contains a hook script which injects this value into the Xcode project if it's not already present so it should be set in the Xcode project like this:

I'm not really sure what else to suggest, other than to say there are plenty of other users of this plugin who are not encountering this issue (myself included) so I feel the cause of the problem must be specific to your development environment.
@dpa99c I really appreciate your help. Not only here, I see your name and answers in different threads so thanks.
The issue on my end was that I was targeting specific device, for example iPhone 11. this build succeeded for development but not for release, which makes sense.
So I change the target to be Any iOS Device (arm64) and the build succeeded. (as in your picture)
Also having the Undefined symbol: _OBJC_CLASS_$_FIRFirestore issue.
It occurs when I try to build the app for iPhone 11 simulator. Building for my real device works.
Here's the error message:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_FIRFirestore", referenced from:
objc-class-ref in AppDelegate+FirebasePlugin.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
$(inherited) is set, my Other Linker flags looks like in @dpa99c 's screenshot
What I tried so far without success:
I tried all the above, but I have the same issue. Also with the example project.
Any advice would be greatly appreciated.
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_FIRFirestore", referenced from:
objc-class-ref in AppDelegate+FirebasePlugin.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
In my case, I tried the following and build succeeded.
Environment information
cordova: 10.0.0
cordova ios: 6.1.1
cordova-plugin-firebasex: 11.0.3-cli
npm: 6.14.8
node: 14.9.0
Homebrew: 2.5.6
ruby: 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-darwin19]
gem: 3.1.4
cocoapods: 1.10.0
macOS: Catalina 10.15.7
same issue here, unable to build a --prod --release build..
for development it works fine
edit:
when i build with cli.. the build fails with --prod
when i build with xcode the build succeeds and the app is loading.. but it seems there is something broken because the ion-content is empty... but just on ipad.. on iphone it is working
Most helpful comment
Also having the
Undefined symbol: _OBJC_CLASS_$_FIRFirestoreissue.It occurs when I try to build the app for iPhone 11 simulator. Building for my real device works.
Here's the error message:
$(inherited)is set, myOther Linker flagslooks like in @dpa99c 's screenshotWhat I tried so far without success: