Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

linker command failed in react native app, using react-native-firebase

I developed a react native app using react-native-firebase library. I want to set my app icon, so I used this library:npm install -g yo generator-rn-toolbox from here.

When I try to build the project I receive this error:

Undefined symbols for architecture arm64: "_OBJC_CLASS_$_RCTSRWebSocket", referenced from: objc-class-ref in libReact.a(RCTInspectorPackagerConnection.o) "_OBJC_CLASS_$_RCTReconnectingWebSocket", referenced from: objc-class-ref in libReact.a(RCTPackagerConnection.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) How do I fix this ?

like image 424
Razvan Bretoiu Avatar asked Aug 04 '17 10:08

Razvan Bretoiu


3 Answers

I was able to build the app by placing libRCTWebSocket.a before libReact.

xcode linker settings

like image 172
Build3r Avatar answered Oct 21 '22 17:10

Build3r


I fixed it by manually adding the RCTWebsocket library:

  1. find the RCTWebsocket project: open -R node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj
  2. Drag it into xcode under your projects Libraries folder
  3. on your project, select your project target, then goto "Build phases" --> "Link Binaries With Libraries" --> "+"
  4. Search for libRCTWebSocket.a and add it

your project should build now. If libRCTWebSocket.a in step 4 is not there, try to build the project first.

like image 38
macrozone Avatar answered Oct 21 '22 18:10

macrozone


I had the similar issue for iOS 12, XCode 10. For those that may help (and avoid losing days like me..), i had to add the libRCTWebSocket.a and the libfishhook.a binaries in the YourProject -> Targets -> YourProject -> Link Binary With Libraries list

like image 5
Sebastien H. Avatar answered Oct 21 '22 18:10

Sebastien H.