When compiling our project with RN-Firebase 2.0.5 I get a weird compilation error in xcode:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_RNFirebaseDatabaseReference", referenced from:
objc-class-ref in libRNFirebase.a(RNFirebaseDatabase.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I manually added react-native-firebase when it was at 2.0.0. We run the project via pods. Did something in the set-up change since than? I hate those kind of errors.....
platform :ios, '9.0'
target 'name' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
# Pods for 'name'
pod "Yoga", :path => "../node_modules/react-native/ReactCommon/yoga"
pod 'React', :path => '../node_modules/react-native', :subspecs => [
'BatchedBridge', # Required For React Native 0.45.0+
'Core',
'RCTActionSheet',
'RCTAnimation',
'RCTGeolocation',
'RCTImage',
'RCTLinkingIOS',
'RCTNetwork',
'RCTSettings',
'RCTText',
'RCTVibration',
'RCTWebSocket'
# Add any other subspecs you want to use in your project
]
pod 'react-native-fbsdk', :path => '../node_modules/react-native-fbsdk/iOS'
# Required by RNFirebase
pod 'Firebase/Core'
pod 'RNFirebase', :path => '../node_modules/react-native-firebase'
pod 'BVLinearGradient', :path => '../node_modules/react-native-linear-gradient'
# [OPTIONAL PODS] - comment out pods for firebase products you won't be using.
# pod 'Firebase/AdMob'
pod 'Firebase/Analytics'
pod 'Firebase/Auth'
pod 'Firebase/Crash'
pod 'Firebase/Database'
pod 'Firebase/DynamicLinks'
pod 'Firebase/Messaging'
pod 'Firebase/RemoteConfig'
pod 'Firebase/Storage'
# Goolge Login
pod 'GoogleSignIn'
# Required by Code-Push
pod 'CodePush', :path => '../node_modules/react-native-code-push'
pod 'GoogleMaps'
pod 'react-native-maps', path: '../node_modules/react-native-maps' #<- PATH to your node_modules/react-native-maps directory
pod 'react-native-google-maps', path: '../node_modules/react-native-maps' #<- PATH to your node_modules/react-native-maps directory
end
# React-Native Maps
post_install do |installer|
installer.pods_project.targets.each do |target|
if target.name == "react-native-google-maps"
target.build_configurations.each do |config|
config.build_settings['CLANG_ENABLE_MODULES'] = 'No'
end
end
end
end
Okay... if anybody comes accross this magic error, try this. It solved the problem (for now).
Close Xcode and packanger.
Clear Xcode Cache
rm -rf ~/Library/Developer/Xcode/DerivedData
Go into ios folder
cd ios
Clear CocoaPods Cache
pod deintegrate && pod cache clean --all
Re-Install Pods
pod install
The install can take now a veeery long time - if it seems to be stuck, you should re-setup cocoa with an update before installing again, as follows:
gem install cocoapods
(you maybe have to use sudo)
than
pod repo remove master --verbose && pod setup --verbose && pod install --verbose
than
pod install
same problem here, it can work when building with react-native run-ios
,
but it fails when archiving
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_RNFirebaseDatabaseReference", referenced from:
objc-class-ref in libRNFirebase.a(RNFirebaseDatabase.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I ran into a same issue. For the issue was fixed by upgrading to the latest cocoapods version and recreating the ios project.
i had same issue with RN 0.47.0
xcode: i built success. after i built with command line (react-native run-ios). it's not work with error message
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_RNFirebaseDatabaseReference", referenced from:
objc-class-ref in libRNFirebase.a(RNFirebaseDatabase.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
update:
after i had run react-native unlink react-native-firebase. i tried re-build with command line. it alerted successful but it's crash when startup :(
react-native log-ios: Service exited due to Abort trap: 6
Same here, the suggestions mentioned above don't help either.
@Damnum @Shinichi52 @mindhivefi @alfonsodev @D1no
I've just released v2.1.1 to hopefully fix the problem. Can you see if this fixes it for you?
Hi @chrisbianca,
I tried upgrade v2.1.1 and re-install pod. When I ran app with command react-native run-ios
. It's crash when startup. Run with xcode is working fine
log with react-native log-ios
Aug 11 08:57:07 xxx-MacBook-Pro assertiond[67376] <Warning>: Submitted job with label: UIKitApplication:com.xxxxxx[0xf925][67376]
Aug 11 08:57:07 xxx-MacBook-Pro SpringBoard[67371] <Warning>: [com.xxxxxx] Bootstrap complete with label: UIKitApplication:com.xxxxxx[0xf925][67376]
Aug 11 08:57:07 xxx-MacBook-Pro com.apple.CoreSimulator.SimDevice.9EE8E2AC-9C13-43F6-A580-8E722572AC45.launchd_sim[67354] (UIKitApplication:com.xxxxxx[0xf925][67376][73582]) <Notice>: Service exited due to Abort trap: 6
Aug 11 08:57:09 xxx-MacBook-Pro assertiond[67376] <Warning>: Deleted job with label: UIKitApplication:com.xxxxxx[0xf925][67376]
For me, this resolved the issue! Thanks @chrisbianca
For the record, for react-native run-ios
to work I had to clean my Xcode Cache with
rm -rf ~/Library/Developer/Xcode/DerivedData
and delete the entire local build folder with
rm -rf ./ios/build
@Shinichi52 run-ios
is not great as it seems to not show you the full errors or warnings. It also has no control over cache cleaning like XCode does. I'd stick with using XCode anyway, as you can't change any of the project settings required to deliver the app without it anyway!
Upgraded from 2.0.5 -> 2.1.1 works
What I did.
Clean the Repo to get rid of all the chaches (stage your changes first):
git clean -fdx -e .vscode
(exclude folders such as .vscode with the -e flag)
Delete xCode Derived Data cache: rm -rf ~/Library/Developer/Xcode/DerivedData
Update to 2.1.1: yarn upgrade-interactive
(select react-native-firebase and hit enter)
Install pods: cd ios && pod install && cd ..
Since we have different schemas, I run the app from xcode.
Thank you guys for the very quick turnaround. Impressive! FYI: We just joined as patrons (https://www.patreon.com/invertase/posts) to support you guys and the react-native-firebase project. Thanks! 🚀
Awesome :) Thanks for helping debug it too!
I have tried all the methods above and still I get the same error. However, I used manual installation method and followed @AndreiCalazans here and @loukandr .. here but after that I still get above error and it says "undefined symbols for architecture x86_64 react native" :( Anyone any suggestions?
Actually, I tried with pod method but it breaks all the other libraries :(
I am using the following:
"react-native": "^0.55.4",
"react-native-firebase": "^4.3.7",
Firebase iOS SDK - 5.3.0
I am only using DynamicLink and Messaging. Following is the trace:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_FIRAnalytics", referenced from:
objc-class-ref in libRNFirebase.a(RNFirebaseAnalytics.o)
"_OBJC_CLASS_$_FIRAnalyticsConfiguration", referenced from:
objc-class-ref in libRNFirebase.a(RNFirebaseAnalytics.o)
"_OBJC_CLASS_$_FIRApp", referenced from:
objc-class-ref in AppDelegate.o
objc-class-ref in libRNFirebase.a(RNFirebase.o)
objc-class-ref in libRNFirebase.a(RNFirebaseUtil.o)
"_OBJC_CLASS_$_FIRDynamicLinkAndroidParameters", referenced from:
objc-class-ref in libRNFirebase.a(RNFirebaseLinks.o)
"_OBJC_CLASS_$_FIRDynamicLinkComponents", referenced from:
objc-class-ref in libRNFirebase.a(RNFirebaseLinks.o)
"_OBJC_CLASS_$_FIRDynamicLinkComponentsOptions", referenced from:
objc-class-ref in libRNFirebase.a(RNFirebaseLinks.o)
"_OBJC_CLASS_$_FIRDynamicLinkGoogleAnalyticsParameters", referenced from:
objc-class-ref in libRNFirebase.a(RNFirebaseLinks.o)
"_OBJC_CLASS_$_FIRDynamicLinkIOSParameters", referenced from:
objc-class-ref in libRNFirebase.a(RNFirebaseLinks.o)
"_OBJC_CLASS_$_FIRDynamicLinkItunesConnectAnalyticsParameters", referenced from:
objc-class-ref in libRNFirebase.a(RNFirebaseLinks.o)
"_OBJC_CLASS_$_FIRDynamicLinkNavigationInfoParameters", referenced from:
objc-class-ref in libRNFirebase.a(RNFirebaseLinks.o)
"_OBJC_CLASS_$_FIRDynamicLinkSocialMetaTagParameters", referenced from:
objc-class-ref in libRNFirebase.a(RNFirebaseLinks.o)
"_OBJC_CLASS_$_FIRDynamicLinks", referenced from:
objc-class-ref in libRNFirebase.a(RNFirebaseLinks.o)
"_OBJC_CLASS_$_FIRInstanceID", referenced from:
objc-class-ref in libRNFirebase.a(RNFirebaseInstanceId.o)
objc-class-ref in libRNFirebase.a(RNFirebaseMessaging.o)
"_OBJC_CLASS_$_FIRMessaging", referenced from:
objc-class-ref in libRNFirebase.a(RNFirebaseMessaging.o)
"_OBJC_CLASS_$_FIROptions", referenced from:
objc-class-ref in libRNFirebase.a(RNFirebase.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I set up using pod and it is working fine. So, maybe above comment is not valid anymore. Thanks guys! Followings are the steps I did in my project:
react-native unlink react-native-firebase
react-native install --save react-native-firebase
cd ios
pod init
pod update
pod install (will get some warnings but the above link shows how to solve them. open xcworkspace file in xcode and solve them.)
react-native link react-native-firebase
open xcworkspace file in xcode.
Build
@Aung-Myint-Thein did it work with all other linked libraries from earlier? Or what happens to them?
i have the same problem, but im not using cocoapods, is there any way without cocoapods ?
I tried without cocoapods way and it was much more complicated and I didnt
get it. So, currently, my project is using cocoapods. It is much simpler
and not much trouble.
On Wed, 2 Jan 2019 at 9:20 AM, krisna ilafat notifications@github.com
wrote:
i have the same problem, but im not using cocoapods, is there any way
without cocoapods ?—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/invertase/react-native-firebase/issues/321#issuecomment-450779075,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAlYDtNdKBeg7LjOSMZ2znBq2icFuR2vks5u_B6NgaJpZM4Ox87-
.>
Sent from Gmail Mobile
Im using Cocoa pods for just firebase, all the rest is like before.
I have the same issue
any solution guys? im not using cocoa pod. updated project from 0.57 to 0.58 now.
No success
Undefined symbols for architecture arm64:
"_GULIsLoggableLevel", referenced from:
_FIRIsLoggableLevel in FirebaseCore(FIRLogger.o)
-[APMMonitor isLoggableLevel:] in GoogleAppMeasurement(APMMonitor_405c5a637e87914c89c37652996d219d.o)
"_GULLogBasic", referenced from:
_FIRLogBasic in FirebaseCore(FIRLogger.o)
-[APMASLLogger logMessage:logTag:messageCode:withLogLevel:] in GoogleAppMeasurement(APMASLLogger_b06c35e24aea4d3ad666632e11e79ef6.o)
"_GULLogError", referenced from:
+[APMAnalytics startWithAppID:origin:options:] in GoogleAppMeasurement(APMAnalytics_f5f2b01aed09e7d23917a3e8a400242e.o)
-[APMUserDefaults synchronize] in GoogleAppMeasurement(APMUserDefaults_cec267d1ff21df5a0ffda1a71af1431f.o)
"_GULLogInfo", referenced from:
___44+[UIViewController(APMScreenClassName) load]_block_invoke in GoogleAppMeasurement(UIViewController+APMScreenClassName_bb34840e14481f32c5ecb9ffcac15bff.o)
"_GULLogWarning", referenced from:
+[APMMeasurement sharedInstance] in GoogleAppMeasurement(APMMeasurement_a76ff61c6b4ca85ef91462a646f323a0.o)
-[APMUserDefaults objectForKey:] in GoogleAppMeasurement(APMUserDefaults_cec267d1ff21df5a0ffda1a71af1431f.o)
-[APMUserDefaults setObject:forKey:] in GoogleAppMeasurement(APMUserDefaults_cec267d1ff21df5a0ffda1a71af1431f.o)
-[APMUserDefaults synchronize] in GoogleAppMeasurement(APMUserDefaults_cec267d1ff21df5a0ffda1a71af1431f.o)
___44+[UIViewController(APMScreenClassName) load]_block_invoke in GoogleAppMeasurement(UIViewController+APMScreenClassName_bb34840e14481f32c5ecb9ffcac15bff.o)
"_GULLoggerEnableSTDERR", referenced from:
___FIRLoggerInitializeASL_block_invoke in FirebaseCore(FIRLogger.o)
"_GULLoggerForceDebug", referenced from:
___FIRLoggerInitializeASL_block_invoke in FirebaseCore(FIRLogger.o)
"_GULLoggerInitializeASL", referenced from:
___FIRLoggerInitializeASL_block_invoke in FirebaseCore(FIRLogger.o)
"_GULLoggerRegisterVersion", referenced from:
___FIRLoggerInitializeASL_block_invoke in FirebaseCore(FIRLogger.o)
"_GULSetLoggerLevel", referenced from:
_FIRSetLoggerLevel in FirebaseCore(FIRLogger.o)
-[APMMonitor setDebugModeEnabled:] in GoogleAppMeasurement(APMMonitor_405c5a637e87914c89c37652996d219d.o)
"_OBJC_CLASS_$_GULAppDelegateSwizzler", referenced from:
objc-class-ref in GoogleAppMeasurement(APMAnalytics_f5f2b01aed09e7d23917a3e8a400242e.o)
"_OBJC_CLASS_$_GULAppEnvironmentUtil", referenced from:
objc-class-ref in FirebaseMessaging(FIRMessagingAnalytics.o)
objc-class-ref in FirebaseMessaging(FIRMessagingReceiver.o)
objc-class-ref in FirebaseAuth(FIRAuth.o)
objc-class-ref in FirebaseAuth(FIRAuthAPNSTokenManager.o)
objc-class-ref in FirebaseAuth(FIRAuthAppDelegateProxy.o)
objc-class-ref in FirebaseAuth(FIRAuthDefaultUIDelegate.o)
objc-class-ref in FirebaseCoreDiagnostics(FIRDiagnostics_afb9975b7573ce8caa0e4380e6bfbe31.o)
...
"_OBJC_CLASS_$_GULMutableDictionary", referenced from:
objc-class-ref in GoogleAppMeasurement(APMRemoteConfig_a87cea1e5d19294f87a4448795cd24c6.o)
"_OBJC_CLASS_$_GULNetwork", referenced from:
objc-class-ref in GoogleAppMeasurement(APMAnalytics_f5f2b01aed09e7d23917a3e8a400242e.o)
objc-class-ref in GoogleAppMeasurement(APMMeasurement_a76ff61c6b4ca85ef91462a646f323a0.o)
objc-class-ref in GoogleAppMeasurement(APMAppDelegateInterceptor_d25c2dc381ddbd5008199366846aae05.o)
objc-class-ref in FirebaseCoreDiagnostics(FIRClearcutLogger_45763904baa6658ff86b47cac2ab23e7.o)
"_OBJC_CLASS_$_GULReachabilityChecker", referenced from:
objc-class-ref in FirebaseMessaging(FIRMessaging.o)
"_OBJC_CLASS_$_GULSwizzler", referenced from:
objc-class-ref in GoogleAppMeasurement(UIViewController+APMScreenClassName_bb34840e14481f32c5ecb9ffcac15bff.o)
"_OBJC_CLASS_$_GULUserDefaults", referenced from:
objc-class-ref in FirebaseCoreDiagnostics(FIRDiagnostics_afb9975b7573ce8caa0e4380e6bfbe31.o)
objc-class-ref in FirebaseInstanceID(FIRInstanceIDCheckinPreferences_36766016f801e2f19278d2e4a3dc9dc2.o)
objc-class-ref in FirebaseInstanceID(FIRInstanceIDUtilities_6068b4cdd1114b87139202a3c6ae828a.o)
"_kGULNetworkHTTPStatusCodeCannotAcceptTraffic", referenced from:
-[APMMeasurement networkUploadCompletionHandlerWithResponse:error:] in GoogleAppMeasurement(APMMeasurement_a76ff61c6b4ca85ef91462a646f323a0.o)
-[APMMeasurement networkRemoteConfigFetchCompletionHandler:data:error:] in GoogleAppMeasurement(APMMeasurement_a76ff61c6b4ca85ef91462a646f323a0.o)
"_kGULNetworkHTTPStatusCodeNotFound", referenced from:
-[APMMeasurement networkRemoteConfigFetchCompletionHandler:data:error:] in GoogleAppMeasurement(APMMeasurement_a76ff61c6b4ca85ef91462a646f323a0.o)
"_kGULNetworkHTTPStatusCodeNotModified", referenced from:
-[APMMeasurement networkRemoteConfigFetchCompletionHandler:data:error:] in GoogleAppMeasurement(APMMeasurement_a76ff61c6b4ca85ef91462a646f323a0.o)
"_kGULNetworkHTTPStatusCodeUnavailable", referenced from:
-[APMMeasurement networkUploadCompletionHandlerWithResponse:error:] in GoogleAppMeasurement(APMMeasurement_a76ff61c6b4ca85ef91462a646f323a0.o)
-[APMMeasurement networkRemoteConfigFetchCompletionHandler:data:error:] in GoogleAppMeasurement(APMMeasurement_a76ff61c6b4ca85ef91462a646f323a0.o)
"_kGULNetworkHTTPStatusNoContent", referenced from:
-[APMMeasurement networkUploadCompletionHandlerWithResponse:error:] in GoogleAppMeasurement(APMMeasurement_a76ff61c6b4ca85ef91462a646f323a0.o)
-[APMMeasurement networkRemoteConfigFetchCompletionHandler:data:error:] in GoogleAppMeasurement(APMMeasurement_a76ff61c6b4ca85ef91462a646f323a0.o)
"_kGULNetworkHTTPStatusOK", referenced from:
-[APMMeasurement networkUploadCompletionHandlerWithResponse:error:] in GoogleAppMeasurement(APMMeasurement_a76ff61c6b4ca85ef91462a646f323a0.o)
-[APMMeasurement networkRemoteConfigFetchCompletionHandler:data:error:] in GoogleAppMeasurement(APMMeasurement_a76ff61c6b4ca85ef91462a646f323a0.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
On React-native 60.4, followed everything here. Cannot build the project. (So typical of RN..)
ld: warning: directory not found for option '-L/Users/oo/Library/Developer/Xcode/DerivedData/righter-czofbqejhzpmveescwmgwextrvgb/Build/Products/Debug-iphonesimulator/yoga'
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_RCCManager", referenced from:
objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Also ran into this updating to 60.4, unsuppressed by previous solutions. @ollydixon did you find a fix?
Same here. RN 0.60.4
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_RNFirebaseMessaging", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_RNFirebaseNotifications", referenced from:
objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I got this error again after updating to RN 0.60.4 last night. However, I fixed with all the steps I did as follows:
I checked my rnfirebase version and it is not supported for RN 60.4. Most likely it is the case for you guys. So, I had to update it by just changing the version to 5.5.6 then npm i
again.
Then, I also need to update Podfile to use the latest libraries. I just follow https://rnfirebase.io/docs/v5.x.x/releases/v5.5.x#Upgrade-instructions and tried to run again.
Then, it might not run successfully. Then
1) Do product > clean
2) Close Xcode
3) Re-run pod install (from the command line)
4) Re-open the .xcworkspace
5) Do product > clean
6) Try a build
(as mentioned in https://rnfirebase.io/docs/v5.x.x/troubleshooting/ios#Duplicate-Symbols-/-Undefined-Symbols-(build-time-error) )
Another note you guys have to be careful is that RN 0.60.x uses auto-linking and it can give a bit of problem if you don't "unlink" first before updating.
I also wrote a post with my updated Podfile content here. Hope some of them will be useful. Let me know how it goes. The process is really painful but once it is running, the RN 0.60.4 is quite good.
I tried following the comment above to resolve my issue, but I continue to receive the error outlined in the first comment.
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_RNFirebaseMessaging", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_RNFirebaseNotifications", referenced from:
objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The weirdest thing is that this is on a project that previously built (and is live on the app store). When I stash all of my changes and pull the repo from master to rebuild, the project fails with this error again.
I've followed the guide and updated everything, but to no avail. This is on an ExpoKit project as well.
I am currently having conflicts to implement the GoogleAnalytics library, I already made it work, but I get this warning that GaiDicctionaryBuilder does not recognize.
Neither is Google providing support, its library is out of date, so I had to create a module that can use its libraries.
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_GAIDictionaryBuilder", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_GAI", referenced from:
objc-class-ref in AppDelegate.o
"_kGAICampaignMedium", referenced from:
Example_Smart.AppDelegate.application(_: __C.UIApplication, didFinishLaunchingWithOptions: [__C.UIApplicationLaunchOptionsKey : Any]?) -> Swift.Bool in AppDelegate.o
"_kGAICampaignSource", referenced from:
Example_Smart.AppDelegate.application(_: __C.UIApplication, didFinishLaunchingWithOptions: [__C.UIApplicationLaunchOptionsKey : Any]?) -> Swift.Bool in AppDelegate.o
"_kGAIScreenName", referenced from:
Example_Smart.AppDelegate.application(_: __C.UIApplication, didFinishLaunchingWithOptions: [__C.UIApplicationLaunchOptionsKey : Any]?) -> Swift.Bool in AppDelegate.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Most helpful comment
Okay... if anybody comes accross this magic error, try this. It solved the problem (for now).
Close Xcode and packanger.
Clear Xcode Cache
rm -rf ~/Library/Developer/Xcode/DerivedData
Go into ios folder
cd ios
Clear CocoaPods Cache
pod deintegrate && pod cache clean --all
Re-Install Pods
pod install
The install can take now a veeery long time - if it seems to be stuck, you should re-setup cocoa with an update before installing again, as follows:
gem install cocoapods
(you maybe have to use sudo)than
pod repo remove master --verbose && pod setup --verbose && pod install --verbose
than
pod install