When i run react-native run-ios,occured as follow
"_FCMNotificationReceived", referenced from:
-[AppDelegate application:didReceiveRemoteNotification:fetchCompletionHandler:] in AppDelegate.o
-[AppDelegate application:didReceiveRemoteNotification:fetchCompletionHandler:] in AppDelegate.o
any one who suffered the same things?
I'm trying to implement this and having the same problem, but only when I run in release mode. In debug mode the build completes successfully.
Here's a more complete error:
Undefined symbols for architecture i386:
"_FCMNotificationReceived", referenced from:
-[AppDelegate application:didReceiveRemoteNotification:fetchCompletionHandler:] in AppDelegate.o
"_OBJC_CLASS_$_RCTBundleURLProvider", referenced from:
objc-class-ref in AppDelegate.o
"_OBJC_CLASS_$_RCTRootView", referenced from:
objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Does your release build successfully?
The more detail, I run the error in debug model
Undefined symbols for architecture x86_64:
"_FCMNotificationReceived", referenced from:
-[AppDelegate application:didReceiveRemoteNotification:fetchCompletionHandler:] 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)
Showing first 200 warnings only
** BUILD FAILED **
The following build commands failed:
Ld build/Build/Products/Debug-iphonesimulator/xxxxx.app/xxxxx normal x86_64
(1 failure)
Installing build/Build/Products/Debug-iphonesimulator/xxxx.app
An error was encountered processing the command (domain=LaunchServicesError, code=0):
I have solved, clean all and run from the base.
@atlanteh did you figure this out? I'm seeing the same thing.
@atlanteh @colorfulberry any updates?
I have the same problem. I have tried clean but that doesn't work.
Undefined symbols for architecture x86_64:
"_FCMNotificationReceived", referenced from:
-[AppDelegate userNotificationCenter:willPresentNotification:withCompletionHandler:] in AppDelegate.o
-[AppDelegate userNotificationCenter:didReceiveNotificationResponse:withCompletionHandler:] 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)
@MagnusEngdal are you using xcode 8?
@evollu Yes
@MagnusEngdal can you get the latest version of this repo v2.2.0?
@evollu Already updated to 2.2.0 a few days ago. It worked before I updated, but it might not be related to that. I updated pretty much everything from Firebase and React Native to XCode and OSX. Hard to say what caused it.
I don't know if the full error helps:
Ld /Users/magnusengdal/Library/Developer/Xcode/DerivedData/recruitapp-cahabphdpzcostdtmzvpurhkckjp/Build/Products/Debug-iphonesimulator/recruitapp.app/recruitapp normal x86_64
cd /Users/magnusengdal/Dropbox/xxx/xxx/xxx/app/ios
export IPHONEOS_DEPLOYMENT_TARGET=8.0
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.0.sdk -L/Users/magnusengdal/Library/Developer/Xcode/DerivedData/recruitapp-cahabphdpzcostdtmzvpurhkckjp/Build/Products/Debug-iphonesimulator -F/Users/magnusengdal/Library/Developer/Xcode/DerivedData/recruitapp-cahabphdpzcostdtmzvpurhkckjp/Build/Products/Debug-iphonesimulator -F/Users/magnusengdal/Dropbox/xxx/xxx/xxx/app/ios -filelist /Users/magnusengdal/Library/Developer/Xcode/DerivedData/recruitapp-cahabphdpzcostdtmzvpurhkckjp/Build/Intermediates/recruitapp.build/Debug-iphonesimulator/recruitapp.build/Objects-normal/x86_64/recruitapp.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -mios-simulator-version-min=8.0 -Xlinker -object_path_lto -Xlinker /Users/magnusengdal/Library/Developer/Xcode/DerivedData/recruitapp-cahabphdpzcostdtmzvpurhkckjp/Build/Intermediates/recruitapp.build/Debug-iphonesimulator/recruitapp.build/Objects-normal/x86_64/recruitapp_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -ObjC -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker /Users/magnusengdal/Library/Developer/Xcode/DerivedData/recruitapp-cahabphdpzcostdtmzvpurhkckjp/Build/Intermediates/recruitapp.build/Debug-iphonesimulator/recruitapp.build/recruitapp.app.xcent -framework GoogleUtilities /Users/magnusengdal/Library/Developer/Xcode/DerivedData/recruitapp-cahabphdpzcostdtmzvpurhkckjp/Build/Products/Debug-iphonesimulator/libRNDeviceInfo.a -framework GoogleInterchangeUtilities /Users/magnusengdal/Library/Developer/Xcode/DerivedData/recruitapp-cahabphdpzcostdtmzvpurhkckjp/Build/Products/Debug-iphonesimulator/libRCTPushNotification.a /Users/magnusengdal/Library/Developer/Xcode/DerivedData/recruitapp-cahabphdpzcostdtmzvpurhkckjp/Build/Products/Debug-iphonesimulator/libReact.a /Users/magnusengdal/Library/Developer/Xcode/DerivedData/recruitapp-cahabphdpzcostdtmzvpurhkckjp/Build/Products/Debug-iphonesimulator/libRCTActionSheet.a -framework FirebaseAnalytics /Users/magnusengdal/Library/Developer/Xcode/DerivedData/recruitapp-cahabphdpzcostdtmzvpurhkckjp/Build/Products/Debug-iphonesimulator/libRCTGeolocation.a /Users/magnusengdal/Library/Developer/Xcode/DerivedData/recruitapp-cahabphdpzcostdtmzvpurhkckjp/Build/Products/Debug-iphonesimulator/libRCTImage.a -framework GoogleSymbolUtilities -framework FirebaseInstanceID -framework GoogleIPhoneUtilities /Users/magnusengdal/Library/Developer/Xcode/DerivedData/recruitapp-cahabphdpzcostdtmzvpurhkckjp/Build/Products/Debug-iphonesimulator/libRCTLinking.a /Users/magnusengdal/Library/Developer/Xcode/DerivedData/recruitapp-cahabphdpzcostdtmzvpurhkckjp/Build/Products/Debug-iphonesimulator/libRCTNetwork.a /Users/magnusengdal/Library/Developer/Xcode/DerivedData/recruitapp-cahabphdpzcostdtmzvpurhkckjp/Build/Products/Debug-iphonesimulator/libRCTSettings.a /Users/magnusengdal/Library/Developer/Xcode/DerivedData/recruitapp-cahabphdpzcostdtmzvpurhkckjp/Build/Products/Debug-iphonesimulator/libRCTText.a -framework FirebaseMessaging /Users/magnusengdal/Library/Developer/Xcode/DerivedData/recruitapp-cahabphdpzcostdtmzvpurhkckjp/Build/Products/Debug-iphonesimulator/libRCTVibration.a /Users/magnusengdal/Library/Developer/Xcode/DerivedData/recruitapp-cahabphdpzcostdtmzvpurhkckjp/Build/Products/Debug-iphonesimulator/libRCTWebSocket.a -Xlinker -dependency_info -Xlinker /Users/magnusengdal/Library/Developer/Xcode/DerivedData/recruitapp-cahabphdpzcostdtmzvpurhkckjp/Build/Intermediates/recruitapp.build/Debug-iphonesimulator/recruitapp.build/Objects-normal/x86_64/recruitapp_dependency_info.dat -o /Users/magnusengdal/Library/Developer/Xcode/DerivedData/recruitapp-cahabphdpzcostdtmzvpurhkckjp/Build/Products/Debug-iphonesimulator/recruitapp.app/recruitapp
Undefined symbols for architecture x86_64:
"_FCMNotificationReceived", referenced from:
-[AppDelegate userNotificationCenter:willPresentNotification:withCompletionHandler:] in AppDelegate.o
-[AppDelegate userNotificationCenter:didReceiveNotificationResponse:withCompletionHandler:] 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)
Showing Recent Issues
"_FCMNotificationReceived", referenced from:
-[AppDelegate userNotificationCenter:willPresentNotification:withCompletionHandler:] in AppDelegate.o
-[AppDelegate userNotificationCenter:didReceiveNotificationResponse:withCompletionHandler:] 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)
try to do a clean build!
can you also check if project is linked correctly?
I ran react-native link react-native-fcm again, followed by a clean build, and now it works! Apparently some links had been lost in all the updates. Android was correctly linked still, but not IOS.
Thanks!
Apparently there's some issues with links in iOS, I have to run react-native unlink react-native-fcm and again react-native link react-native-fcm to make it work.
@jainmitesh09 Have it worked with your project?
@colorfulberry no it did not :/
me too, help me :(
can you post your error? have your cleaned your project?
there is an import on top of app delegate
I had this same issue - they key was doing the unlink, not just relinking.
Unlinking, and relinking again didn't do it for me.
I also had - for some strange reasons - to install react-native-fcm again (npm install -S react-native-fcm).
I then unlinked and relinked the library, and everything builds fine.
I am getting the same error, but unlinking is throwing an error
react-native link react-native-fcm
rnpm-install info Linking react-native-fcm android dependency
rnpm-install info Android module react-native-fcm has been successfully linked
rnpm-install ERR! It seems something went wrong while linking. Error: Expected "/*", "//" or "{" but "<" found.
Please file an issue here: https://github.com/facebook/react-native/issues
Expected "/*", "//" or "{" but "<" found.
@kevando read this https://github.com/evollu/react-native-fcm/issues/142
Thanks @tarr11 but I ended up just linking it manually and everything works now. Thanks for the quick response.
To fix it, I had to update the pod file like below.
pod 'Firebase', '~> 4.0.2'
pod 'Firebase/Core', '~> 4.0.2'
pod 'Firebase/Messaging', '~> 4.0.2'
Most helpful comment
I ran
react-native link react-native-fcmagain, followed by a clean build, and now it works! Apparently some links had been lost in all the updates. Android was correctly linked still, but not IOS.Thanks!