Razvan Bretoiu
Razvan Bretoiu

Reputation: 533

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 ?

Upvotes: 10

Views: 7148

Answers (3)

Sebastien H.
Sebastien H.

Reputation: 7186

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

Upvotes: 5

Build3r
Build3r

Reputation: 1976

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

xcode linker settings

Upvotes: 4

macrozone
macrozone

Reputation: 869

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.

Upvotes: 13

Related Questions