Detached iOS build and running problem


I created a new tabs project, after detaching, I manually add Pods/Headers/Public to the Header Search Paths configuration for my native dependency(react-native-ble) in Xcode. Then I got this build error.
I fixed it by manually adding the RCTWebsocket library:

  1. find the RCTWebsocket project: 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
    It works, but when I run the detached project in my phone, the app crashed.

    Can anyone help me to solve this problem?

Linker issues like this are sometimes caused by having two copies of the same code in your app, like two copies of React Native’s Objective-C. I would also recommend clearing DerivedData and seeing if that helps.