"react-native": "0.50.3"
After running: react-native link react-native-fcm
My pod file contains this lines:
pod 'Firebase/Messaging'
pod 'react-native-fcm', :path => '../node_modules/react-native-fcm'
when trying to pod install:
Installing React (0.11.0)
Using nanopb (0.3.8)
Installing react-native-fcm (10.0.3)
[!] React has been deprecated
then when Im building IOS
In file included from /Users/alex/dev/tandem/node_modules/react-native-fcm/ios/RNFIRMessaging.m:1:
/Users/alex/dev/tandem/node_modules/react-native-fcm/ios/RNFIRMessaging.h:7:9: fatal error: 'React/RCTEventEmitter.h' file not found
#import <React/RCTEventEmitter.h>
if I remove pod 'react-native-fcm', :path => '../node_modules/react-native-fcm'
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_RNFIRMessaging", referenced from:
objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture x86_64
I tried manually linking React and yoga
pod "yoga", :path => "../node_modules/react-native/ReactCommon/yoga"
pod 'React', :path => '../node_modules/react-native'
pod 'react-native-fcm', :path => '../node_modules/react-native-fcm'
and looks like it solved the build problem, now have to check if it also works
EDIT:
@evollu Can you please look at this issue
I have the same issue, linking of React and Yoga in pods doesn't fix it.
@veedeo your solution worked for me
I had the same problem. I think there is problem with linking. In my case react-native link didn't link library properly. I removed pod 'react-native-fcm', :path => '../node_modules/react-native-fcm' and linked react-native-fcm manually and everything worked fine.
I ran npm install on my whole project again and link worked after that.
@veedeo are you able to create archive for ios with your solution.
Same here
@veedeo I had to do a bit more than that. I ended up with React in the pod and then that cause "ambiguous resolution" problems with react.
It is very similar to: https://github.com/invertase/react-native-firebase/issues/414
And then lots of cache clearing, swearing, and finally a reboot, it started to work. I can't say this is the right solution, and this feels really broken to me @evollu
pod "yoga", :path => "../node_modules/react-native/ReactCommon/yoga"
pod 'React', :path => '../node_modules/react-native'
post_install do |installer|
installer.pods_project.targets.each do |target|
if target.name == "React"
target.remove_from_project
end
end
end
I'm not expert in pod configuration. seems what it does it build react and then remove it?
It is cleaner to do manual linking in my opinion
If you do the manual linking and try to use another google pod like 'GoogleSignIn' then you run into duplicate symbols. I didn't want to manually integrate both. The pod approach is cleaner (when it works!).
Notes: I reset all build and cache to test each option.
Versions:
react-native: 0.53.0
react-native-fcm :^13.3.1
Any solution?
@brunoczo Manual link react-native-fcm and Firebase lib from google solved my problem.
I update my project from rn v0.43 to 0.54 and now have this issue with rn fcm
I try to update react-native-fcm (16.0.0) to last v but it didnt fix it.
Any idea?
Most helpful comment
I tried manually linking React and yoga
and looks like it solved the build problem, now have to check if it also works
EDIT:
@evollu Can you please look at this issue