I'm working on an existing React Native project and in XCode log output I get an endless stream of the following errors
2019-01-09 12:15:49.005630+0000 App [13746:3543026] [] nw_socket_handle_socket_event [C10.1:1] Socket SO_ERROR [61: Connection refused]
2019-01-09 12:15:49.016640+0000 App [13746:3543026] [] nw_socket_handle_socket_event [C10.2:1] Socket SO_ERROR [61: Connection refused]
2019-01-09 12:15:49.017800+0000 App [13746:3543010] [] nw_connection_get_connected_socket [C10] Client called nw_connection_get_connected_socket on unconnected nw_connection
How could I go about figuring out where this error is coming from? It doesn't seem to be affecting the app, but I would like to understand the issue. I suspect it's not the app's JavaScript code, but one of the pods being used:
pod 'Firebase/Core'
pod 'Firebase/Messaging'
pod 'Firebase/Crash'
I heard that Socket.io not worked properly in React Native, so I decided to use plain WebSocket instead. I'm using node.js for implemeting WebSocket server, and it wasn't hard. With browsers, all of I tried worked, but with React native, none of success.
Sorry, something went wrong. Sorry, something went wrong. Sorry, something went wrong. Sorry, something went wrong. Sorry, something went wrong. Sorry, something went wrong. This should be fixed in the latest react-native.
If you are running on the device, check if you have the right IP address in RCTWebSocketExecutor.m. I noticed that this issue occurred when I switched between two different networks (call them A and B). When running on network B, the IP address in the message above was from network A.
File
-> Project Settings
(or Workspace settings
) -> Build system
, in which change the New Build System
to Legacy Build System
.enter image description here
Edit Scheme
=> Run
=> Environment Variables
=> Add OS_ACTIVITY_MODE
:disable in the XCode.Note: This works fine, but keep in mind that it also suppresses all NSLog output you may need for debugging.
enter image description here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With