18

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'
Karolis
  • 2,899
  • 2
  • 23
  • 38

4 Answers4

2
  1. To select XCode10 build system: In Xcode go to File -> Project Settings (or Workspace settings) -> Build system, in which change the New Build System to Legacy Build System.

enter image description here

  1. Temporary fix: 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

Curest0x
  • 71
  • 1
  • 7
2

I was facing the same error

"react": "^17.0.1",
"react-native": "^0.64.0",

Xcode: 13.1
iOS: 15.0
Node: 14.17.6

after investing a lot of time finally I got the solution and it worked for me. I just restarted my machine. I think the issue was with my network I was switched my network while the build was in progress.

AliRehman7141
  • 873
  • 3
  • 12
  • 33
  • You must've had something else going on because rebooting doesn't resolve anything. – Mike S. May 15 '23 at 21:47
  • Thank you! Been trying to figure out why these logs started showing up out of nowhere ~ restarting my machine fixed the issue for me. – Doug Galante Jun 26 '23 at 23:11
0

There is a thread on GitHub about that, it's related to iOS 12+ an Xcode 10+
https://github.com/facebook/react-native/issues/19573

I tried to change the buildSystem and it worked for me:

  • Go to File, then Project Settings or Workspace Settings.
  • Select Legacy Build System from the Build System dropdown.

enter image description here

David Leuliette
  • 1,595
  • 18
  • 26
  • 2
    Doesn't changing to legacy build system sort of just prevent an error message from appearing, rather than actually addressing the issue we are being warned of? – David Chopin Nov 05 '19 at 23:19
  • @DavidChopin Did you get a reply? Did you find a solution? – Yossi May 02 '20 at 20:38
  • BTW, when running on an iPhone, do the iPhone and the Mac need to be on the same WiFi network? – Yossi May 02 '20 at 20:38
-9

If you run your app on ios: 1. Go to ios/APP_NAME/Info.plist 2. Add these two entries to the Info.plist:

<key>NSLocationWhenInUseUsageDescription</key>
<string>We'll show you things near you in the app.</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>We'll show you things near you in the app. With "always" access, we'll
    also send you notifications when you're near something interesting.</string>
Fiona.W
  • 3
  • 3