Rapsssito / react-native-tcp-socket

React Native TCP socket API for Android, iOS & macOS with SSL/TLS support.
MIT License
315 stars 80 forks source link

Incorrect iOS react-native linking for 1.2.2 due to typos in project.pbxproj #58

Closed chico closed 4 years ago

chico commented 4 years ago

Description

Using React Native 0.59.9, after running react-native link react-native-tcp-socket and then react-native run-ios, the iOS build fails with library not found.

I was able to get it working by manually changing the iOS project.pbxproj, as it was incorrectly referencing TcpSocket.xcodeproj and libTcpSocket.a instead of TcpSockets.xcodeproj and libTcpSockets.a (so it's just a typo issue 🙂 ). See my git diff for manual fix below.

Dependencies

react-native 0.59.9 react-native-tcp-socket 1.2.2

Steps to reproduce

Steps to reproduce the behavior:

  1. Add react-native-tcp-socket 1.2.2 to package.json
  2. Run yarn install
  3. Run react-native link react-native-tcp-socket
  4. Run react-native run-ios

Current behavior

The iOS build fails with library not found as it can't find .

Expected behavior

The iOS build works 🤞

Git diff for manual fix

Diff file

diff.txt

Screenshot

Screenshot 2020-06-22 at 10 22 07

Rapsssito commented 4 years ago

@chico, thanks for the feedback! I will create a new branch for RN< 60.0 so you can push your changes as a PR.

chico commented 4 years ago

@Rapsssito the changes that I did I applied locally in my own react native project. I'm not sure how to fix it within the react-native-tcp-socket project since I'm not experienced in native module linking so I'm not sure how 'react-native link' does its linking. I had a look at the iOS project for 1.2.2 https://github.com/Rapsssito/react-native-tcp-socket/blob/v1.2.2/ios/TcpSockets.xcodeproj/project.pbxproj and it looks correct to me so not sure why the linking doesn't work as expected but maybe linking depends on something else that I'm not aware of :/

Rapsssito commented 4 years ago

@chico I am not sure either. Current RN versions rely on automatic linking. I will take a look at your diffs and the project file.

chico commented 4 years ago

@Rapsssito thanks 👍. If there is no easy fix then maybe you can update the README for RN < 60 on how to do the manual fix after running react-native link react-native-tcp-socket.

Rapsssito commented 4 years ago

@chico, I have created a new version of react-native-tcp-socket with React Native <=0.59 compatibility: v1.4.0. It should fix this issue and also provide you with the latest fixes and features. You can check out the RN59 branch for the source code. Hope it helps!

chico commented 4 years ago

@Rapsssito that's awesome, thank you so much, I will try out 1.4.0 soon 🤞