React-native: "__nw_connection_get_connected_socket_block_invoke Connection has no connected handler" in logs

Created on 21 Sep 2016  ·  132Comments  ·  Source: facebook/react-native

Workaround

_Edit by @hramos, maintainer:_

Several solutions have been presented in this thread:

OS_ACTIVITY_MODE

@HADB proposed:

  1. Open Xcode.
  2. Open Product menu.
  3. Select Edit Scheme...
  4. Add the following under Environment Variables:
    Name: OS_ACTIVITY_MODE
    Value: disable
  5. Run your app again

Using react-devtools

Alternatively, ensure react-devtools is installed on your system.

Resolution

This is a known issue in the iOS Simulator. The issue will remain open to increase visibility. We are limited comments on this thread to core contributors. Pull requests with proposed fixes are welcome.

Original Issue

ENV

RN 0.32
iOS 10, iPhone 6 Plus

Problem

The console of Xcode continue print "__nw_connection_get_connected_socket_block_invoke 6 Connection has no connected handler".

Screen

image

Bug Help Wanted Low-Pri iOS

Most helpful comment

Hi, guys! This works for me (on simulator):

  1. Xcode menu -> Product -> Edit Scheme...
  2. Environment Variables -> Add -> Name: "OS_ACTIVITY_MODE", Value:"disable"
  3. Run your app again, done! 😄

All 132 comments

+1

+1 not possible to fetch() remote json data on ios10 w/ RN 0.33

+1 ios 10.0.1 RN 0.33

+1

+1

+1

+1

Also happening with iOS 10.0.1 and RN 0.30

edit: I followed the recommendations here and am no longer getting the messages

Still an issue with:
RN 0.34
XCode 8.0
iOS 10.0 simulator

It's working with the iOS 9.2 simulator, however.

@marcpechaitis I'm not able to get to the library file for RCTWebSocket how did you find it? RTCWebSocket doesn't show up in my targets.

@DrBeak1

screen shot 2016-09-23 at 1 24 20 pm

Thanks for responding @marcpechaitis . Ah. OK - I think the issue is that react-native is integrated into my project, which was originally ONLY a native obj-c project. React was integrated in afterwards (using instructions here). So my project doesn't have a Libraries folder that contains each of the individual xcodeproj files. The files are in the project, just not contained within a target:
screen shot 2016-09-23 at 1 08 19 pm

+1

I was able to track down the RCTWebSocket.xcodeproj, open it, and alter the warning flags but the annoying __nw_connection_get_connected_socket_block_invoke log persists. The method mentioned by @marcpechaitis (ref from here) to fix this does not work for pre-existing apps that have integrated react-native (vs apps that started as react-native apps). I can't even find where this log call is being fired off (not in obj-c files, not in any node-modules). still investigating.

edit: this is only an issue when building against main.jsbundle ... if I build against localhost (debug) these logs go away. I suspect that because I'm building in debug mode RN assumes I want to connect to the debug localhost server; which in this case is not true. My RN development is finished, and that portion of the app is running using the main.jsbundle file I created.

The build error that @marcpechaitis mentioned was fixed in RN 0.33
This error is a runtime error. Interestingly, it works for me in ios 10 simulator but not on the actual device.

@matthiasdilger oops, thought @marcpechaitis was referencing the OP.
screen shot 2016-09-23 at 5 01 17 pm

Hi, guys! This works for me (on simulator):

  1. Xcode menu -> Product -> Edit Scheme...
  2. Environment Variables -> Add -> Name: "OS_ACTIVITY_MODE", Value:"disable"
  3. Run your app again, done! 😄

@HADB still fails on device for me

Got it working on device and simulator now by reassigning all signing certificates and entitlements in the project.

Xcode 8.0, ios10, iphone 5s

Below RCTWebSocket target's compiler settings works for me.
rctwebsocket xcodeproj

None of these solutions work for me at all. I've added in the exceptions in my info.plist and I just can't connect to my package server from my physical phone. I don't want to turn off errors like @HADB mentioned with OS_ACTIVITY_MODE as well, this is a legitimate error.

Any fix for this issue ?

+1

RN 0.34.0
iOS 10.0.1
iPhone 5S

In the iOS 10 simulator, I'm also getting a ton of __nw related log messages.

+1

RN 0.35.0-rc.0
IOS 10.1
Iphone 7 Plus

+1

This seems to be an iOS 10 issue, and not a React Native one.

https://twitter.com/xenadu02/status/776669668404629504

Using OS_ACTIVITY_MODE=disable (as HADB suggests) is the only current workaround.

@aleclarson I agreed with the log part but react-native still fail to fetch the bundle file on IOS 10

@frnk94 Are you talking about the .jsbundle? The packager is serving my development bundle just fine.

You might be using an outdated AppDelegate.m if it doesn't have this:

jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];

@alanchenup I think its an issue with my AppDelegate.m not connecting to my actual device thanks for the reply i'l fix my code ! :). It working great in simulator

i got it solved by xcode menu commands:
product -> clean
and (hold down option key)
product -> 'clean build folder'

+1

RN 0.34.0
iOS 10.0.1
iPhone 5S

working in iOS 10 simulator but not work in real iphone 5S

@pietgk No such luck with that solution for me.

OS_ACTIVITY_MODE=disable works but it's more of a nuclear option given that it hides _all_ your NSLog statements when running on a device. Perhaps it's better to just live with the log pollution for now when running on device.

@aleclarson @frnk94 Actually, the real error we get I think is :
Sending websocketFailed with no listeners registered.

I cannot reload js from server either, on the physical device that is.

+1

+1

@marcpechaitis Thanks for sharing my article!

+1

I get this when I have both remote debugging and console debugging (via react-native log-ios). Disabling remote debugging solves the problem.

@warrenronsiek how to disable remote debugging?

@JansenLi If you don't know what it is, this probably isn't causing the problem. In your simulator hit command+D and a menu will pop up where you can enable or disable 'Debug JS Remotely'.

+1

+1

Got this error when my phone was not connected to Wifi.. 🙈

The solution from HADB above worked for me, but it's missing a few steps in XCode8, which are added here for clarity:

  1. Xcode App -> Product -> Scheme -> Edit Scheme...
  2. Run -> Arguments -> Environment Variables -> Add (+) -> Name: "OS_ACTIVITY_MODE", Value:"disable" -> Close
  3. Run your app again, done! 😄
    This does remove the errors while running, but I'm not sure if it solves the underlying problem.

+1

not helpful, trying to figure out what's going on

Still present on

RN 0.40.0
iOS 10.1
iPhone 6+

(Clean install with react-native init)

Disabling the logs work, or I can just filter and ignore them, but does anyone know what/if something is actually broken from this?

+1

+1

+1

+1
iOS 10.2
RN 0.35

+1
iOS 10.2
RN 0.40

The message '__nw_connection_get_connected_socket_block_invoke' log message is occurring once a second in the 'react-native-router-flux' project I'm evaluating. The message appears to be from a compiled library because a simple text search didn't reveal anything from node_modules etc.

Please have a look at https://github.com/facebook/react-native/issues/10027#issuecomment-261608678 or http://stackoverflow.com/a/39461256/158525
Xcode 8 with iOS 10 displays much more low level debug statements.

+1 RN0.34 and RN0.32

still have the same issue with RN 0.40 and XCode 8.2.1

+1

+1

+1
iOS 10.2
RN 0.35

for me this issue is gone after upgrding to rn0.40

+1
Xcode 8.2.1
RN: 0.40

I have the same project on 2 Macs, stopped working on the one where I had to reinstall node/npm (and therefore all the global dependencies). It still works fine on the other one (however, could not get it working on a real iPhone). So to me it looks like something unrelated to Xcode/iOS.

Update: after cleaning node_modules and npm i, working fine, life's back to normal :)

Well, sort of :) still getting these every second, the app seems to be working though.
__nw_connection_get_connected_socket_block_invoke 60 Connection has no connected handler

And it's gone now. As unexpected and unexplained as it came.

Possibly unrelated, but this issue was solved for me once I turned off the Guided Access accessibility mode off on my iPhone 6. Seems far fetched, but still...

+1
no solutions thus far have helped

Edit Scheme -> Run -> Arguments - new env. var. OS_ACTIVITY_MODE with disable helped me

You can silence the error with OS_ACTIVITY_MODE, this is just spurious logging from the websocket we open to React Devtools.

Hi @javache
I would kindly disagree with your point of view.
Indeed many of us are aware that disabling OS logging will prevent this to show. But this also prevent us to do normal debugging of our apps... Just again last week our team had an issue and it took us for ever until we remember to reactivate the os logs to catch the error and sort our issue...

@pietgk's solution worked for me

that is not an problem.

What's wrong with people closing this issue ? Disabling the error in output console is not a solution. What's causing the problem, what's going on ? Is this an error or a warning ? Why all these same outputs (with an increment) are showing indefinitely ? I think that's the only relevant point. Tell me if I'm wrong...

I am getting this error/warning when using fetch to my api on the net, bundle loads properly(ios10.3/RN 0.43-rc4). Server receives the request and sends the response but RN never receives the response.
So my real issue here is not receiving the response and not about the warnings.

Guys, please reopen this issue. Thanks.

Please look into it.

XCode 8.2.1
RN .43
iOS 10.3
Same thing here. Disabling the console to hide the issue isn't an option for me.

Disabling the console to hide the issue shouldn't be an option for anyone. Closing your eyes also stops you from seeing the warnings.

Disabling the output means I can't debug anything else. This should be reopened!!!

Please reopen the issue.
Sweeping the error under the carpet doesn't sound like a solution at all.

Commenting +1 is not helpful here, so please stop doing that. Per https://twitter.com/xenadu02/status/776669668404629504 this is a simulator issue, which should be resolved in a future update.

Fair comment @javache.

That being said I'm seeing this when running on the device in both debug & release mode. It's not the kind of issue that causes one to lose sleep at night, but it can def be considered noise pollution ;)

So if you recognize it as an problem that should be fixed in a future update, why not keep this issue open to reflect your position on this?

Not an XCode workaround, but this alleviated the pain for me when using the terminal.

react-native log-ios | grep -v __nw_connection_get_connected_socket_block_invoke

@javache

  1. This reproducible on real devices in dev mode.
  2. Also log messages from libnetwork.dylib itself is definitely Apple fail, I have to say that uncontrolled spam in console is personally RN behaviour. If I do not dumb things, I should not see console errors every 2 secs.

Note for RN devs:
Source of problem, is reconnection logic in RCTWebSocketObserver (at least in RN 0.42.3) or in the [RCTDevMenu packagerURL]. Method reconnect spam OS with periodic retries. Most wonderful for me was the fact that it try to connect to 'http://localhost.8081/message' from real device.

@javache Just a heads up:

Per https://twitter.com/xenadu02/status/776669668404629504 this is a simulator issue, which should be resolved in a future update.

Also seeing this on a real device running 10.3.1 (14E304) with RN 0.44.0.

__EDIT:__ Whoops, just saw @vovkasm already informed you, sorry! Was reading from the top but all the "+1"s got to me and I stopped reading.

@javache Running iPhone 5 with iOS 10.2, physical device getting this issue

Did someone say that typing 👍 works well? :trollface:

This is happening on a real device. I could disable the messages, but it sounds like a thing that requires fixing / explaining.

@cmaitchison suggestion does the trick but in my case, the __ at the start are not needed
react-native log-ios | grep -v nw_connection_get_connected_socket_block_invoke

Does anyone foresee a real solution to this instead of just turning off logs? My OCD goes insane at this issue but also about turning off logging. Am I the only one?

@fgaleano your are not the only one. I have an idea, but have no time to implement it currently.
I think, that RN needs to implement some sort of configuration flag to optionally enable/disable connect to host machine. Probably this flag can be runtime switch in dev menu... but not sure.

Currently I use various workarounds to filter out unwanted messages from the console (grep or equivalents if log to terminal). I wouldn't recommend to disable logs with OS_ACTIVITY_MODE, because it hides other important messages :-/

I get that posting +1 isn't helpful. How is it helpful closing an open issue? Seems like Facebook has some strange kafkaesque policies on bugs

@vovkasm How do you filter out messages in xCode?

@andreyslyusar nohow, Xcode has not any filters in console :-(, also some advanced filters exists in Console application on Sierra.

But grep still most powerful way to do filtering to me, so I use iOS Console, it contains command line application inside bundle.
So I can do /Applications/iOS\ Console.app/Contents/Resources/iosconsole | egrep anything from terminal.

Just some thoughts on this. Sure, setting the OS_ACTIVITY_MODE to disable, blocks the natively thrown errors from being thrown. That being said, if you are in the test-debug phase, seeing the constant slew of nw_connection_get_connected_socket_block_invoke messages can get in the way of seeing what we actually want to see in the console (checking outputs, app state, etc). As long as you keep in mind this fix is temporary, and can be of great aid. Ciao!

It still happens with RN 0.44.0, iOS 10, iPhone 5S.

Keep seeing "__nw_connection_get_connected_socket_block_invoke" every second is very annoying, so OS_ACTIVITY_MODE temporary fix is very helpful.

Seeing this too. Have been for a while. Been ignoring it for a while, but it's getting to me :).

RN 0.44, Xcode 8.3.3

To expand on the explanation from @javache, this error is from the websocket that is built into react-native to connect to the react-devtools. If you aren't running react-devtools while debugging, then you will get this error, and it also pumps a bunch of messages across the bridge complaining about not being able to open the websocket (you will only see those errors if you are using something like rn-snoopy).

The error will stop as soon as you install and open react-devtools. See these instructions for how to do it:
https://github.com/facebook/react-devtools/blob/master/packages/react-devtools/README.md

@emusgrave,

  1. neither @javache nor anyone from facebook did anything to explain the issue in this thread :-(
  2. react-devtools is good when it works :-) but most times you'll run into bugs (for ex. debugger simple not working in RN 0.45.1, why devtools will?)
  3. did your got react-devtools working when run application on real iOS device?

@vovkasm
Regarding your #3, I was able to get react-devtools working from a real iOS device, but the message in the xcode console still comes up. I think that is because of the way I solved it, as follows:

At the top of my entry point in JS, I added the following hook into react-devtools:

   require('react-devtools-core').connectToDevTools({
     host: '192.168.2.115',
     port: '8097',
   });

(obviously replace the IP with your own workstation IP address).

That creates the connection to react-devtools, but it seems like the internal react-native code is still trying its own connection, and so the message continues to show up in the xcode console.

I have not yet worked out how to conditionally use the require('react-devtools-core') solution ONLY when using a physical device without manually (un)commenting out the code.

I will second that this was a react-devtools problem for me. Once I installed them, I had all messages immediately stop. Here are the installation instructions: https://github.com/facebook/react-devtools/blob/master/packages/react-devtools/README.md

It's indead react-devtools problem, as soon as I start it up, the annoying logs stops.

So it was react-devtools all along?? They should put that in HUGE BLACK LETTERS!

@fgaleano SOLUTION = INSTALL REACT-DEVTOOLS
;)

https://github.com/facebook/react-native/commit/878b7e42fae990df745af2db6ac50cbac8a8ce1c removes this log message in development by redirecting an internal apple log function.

It is resonable workaround. It would be very good also to have react-devtools functional optional.

Having it optional would make the experience worse overall. I strongly believe in debug tools being central to what makes developing with react native awesome.

After some thinking, this is bad idea at all.

  1. It already waste more work than proper fix
  2. It use questionable and hard-to-debug technique to hide real warnings ("real warning" here is not nw_connection... line in logs itself, but infinity counts of such lines)
  3. It bring to project danger tool as dependency
  4. It hide all such warnings (not only from badly designed react-devtools connection, but useful if app developer do same mistake)
  5. It hide infinity reconnection cycle on real device

I strongly believe that developer experience with react-native would be better with more transparent and clear code and behavior, not with more and more layers of workarounds.

It is a bug that the warning even displays on newer ios versions. So this isn't actually hiding anything useful. The socket reconnection only happens on debug builds and never on release builds. It is all optionally compiled with the RCT_DEV flag.

If this chnage causes any problems I am more than willing to remove it but currently it hides an issue that was annoying a lot of developers.

@matthiasdilger **Got it working on device and simulator now by reassigning all signing certificates and entitlements in the project.

Xcode 8.0, ios10, iphone 5s** how you did that please; thank you

Still seeing this error as of react-native 0.48.3. Ignoring errors is a hack, not a solution!

I got the logs to go away by setting up react-devtools. Here are the steps (using React v0.48):

  1. Install react-devtools: npm install -g react-devtools
  2. Run react-devtools: react-devtools
  3. In your project, edit node_modules/react-native/Libraries/Core/Devtools/setupDevtools.js by replacing 'localhost' with your development machine's IP address.
  4. Build and run your project in Xcode.

Thanks @takameyer. Note: just running react-devtools works for me, no need to edit setupDevtools.js.

@lrettig it's actually needed when debugging on a real device.

There is a pull request in order to make the IOS native code fill in the local IP (of the debugger machine):
https://github.com/facebook/react-native/issues/14431

It sounds stupid to require editing a JS module code to prevent this log pollution. the OS_ACTIVITY_MODE solution became useless with IOS 11, as it blocks all NSLog statements, not only system logs. In our case, no log anymore - which I had a hard time linking to this hack I put in place before!
Like someone else said, a hack is not good. A proper fix is required. This is more than an inconvenience when trying to debug stuff :(

I have confirmed the same issue in the following env:
iOS: 10.3.3 (real device)
React Native: 0.48
Xcode:9.0
And the app runs really SLOW.(It wasn't)

HOWEVER, when in Xcode --> Product --> Schema --> Edit Schema --> Info Tab --> Build Configuration --> set from Debug to 'Release'
Run App again, the Error message is gone, and the app works as expected.
Of course, this IS NOT a solution of any sort, but I just want to share this and maybe give a tiny push to the REAL solution.
Happy coding!

Same issue.
RN: 0.49.3
Running iOS 11
Xcode 9
Real device

same issue

RN: 0.49.0
iOS 11, iPhone 5s
Xcode 9

Please reopen this. I am unable to reload and debug on device.

Still happening for me too... can't run on device, but simulator works.

RN: 0.49.0
iOS 11, iPhone 7
Xcode: 9.0.1

This issue is still around. I wondered about long start up times during on device testing. Changing the Build Configuration like @kawashimaken worked for me. Developing and debugging is impossible at the moment.

Thank you @takameyer. The steps you mentioned fixed the issue.

cool @takameyer

@takameyer using react-devtools quiets the XCode logs, but I have a what I think related issue. I keep getting endless network output in React Native Debugger with a call called callbacks_poll that only occurs when remote debugging is active. I see the same in Chrome debugger. It also creates a memory leak. But I'm not sure if it's the same issue. It seems to have shown up recently. I'm on RN0.49.5

screen shot 2017-11-24 at 17 11 55

This still is a problem on React Native 0.50.4, Xcode 9.1, iOS 11.1, macOS High Sierra

TCP Conn 0x1c03627c0 Failed : error 0:61 [61]
[] nw_connection_get_connected_socket 164 Connection has no connected handler
over and over again, drowning out all other logs...

I'm having the same issue on my iPhone 6s, iOS 10. Compiled the iOS project from Xcode as per the wiki instructions and the app freezes in the splash screen. This is the log I'm getting:

2017-12-05 13:20:06.849 [info][tid:main][RCTBatchedBridge.m:75] Initializing <RCTBatchedBridge: 0x1c01ba080> (parent: <RCTBridge: 0x1c00d0450>, executor: RCTJSCExecutor)
2017-12-05 13:20:06.854783-0300 StatusIm[1755:195391] Initializing <RCTBatchedBridge: 0x1c01ba080> (parent: <RCTBridge: 0x1c00d0450>, executor: RCTJSCExecutor)
2017-12-05 13:20:09.213 [info][tid:com.facebook.react.JavaScript] There was an error collecting entropy from the browser:
2017-12-05 13:20:09.213595-0300 StatusIm[1755:195564] There was an error collecting entropy from the browser:
2017-12-05 13:20:09.216 [info][tid:com.facebook.react.JavaScript] { [TypeError: undefined is not an object (evaluating 'sjcl.random')]
  line: 61724,
  column: 28,
  sourceURL: 'http://192.168.0.13.xip.io:8081/index.ios.bundle?platform=ios&dev=true&minify=false' }
2017-12-05 13:20:09.215912-0300 StatusIm[1755:195564] { [TypeError: undefined is not an object (evaluating 'sjcl.random')]
  line: 61724,
  column: 28,
  sourceURL: 'http://192.168.0.13.xip.io:8081/index.ios.bundle?platform=ios&dev=true&minify=false' }
2017-12-05 13:20:09.305 [info][tid:com.facebook.react.JavaScript] There was an error collecting entropy from the browser:
2017-12-05 13:20:09.305135-0300 StatusIm[1755:195564] There was an error collecting entropy from the browser:
2017-12-05 13:20:09.306 [info][tid:com.facebook.react.JavaScript] { [Error: Requiring module "629", which threw an exception.]
  line: 136,
  column: 15,
  sourceURL: 'http://192.168.0.13.xip.io:8081/index.ios.bundle?platform=ios&dev=true&minify=false' }
2017-12-05 13:20:09.305704-0300 StatusIm[1755:195564] { [Error: Requiring module "629", which threw an exception.]
  line: 136,
  column: 15,
  sourceURL: 'http://192.168.0.13.xip.io:8081/index.ios.bundle?platform=ios&dev=true&minify=false' }
2017-12-05 13:20:09.526 [info][tid:main][RCTRootView.m:284] Running application StatusIm ({
    initialProps =     {
    };
    rootTag = 1;
})
2017-12-05 13:20:09.526001-0300 StatusIm[1755:195391] Running application StatusIm ({
    initialProps =     {
    };
    rootTag = 1;
})
2017-12-05 13:20:09.530 [info][tid:com.facebook.react.JavaScript] Running application "StatusIm" with appParams: {"rootTag":1,"initialProps":{}}. __DEV__ === true, development-level warning are ON, performance optimizations are OFF
2017-12-05 13:20:09.530103-0300 StatusIm[1755:195564] Running application "StatusIm" with appParams: {"rootTag":1,"initialProps":{}}. __DEV__ === true, development-level warning are ON, performance optimizations are OFF
2017-12-05 13:20:09.587 [info][tid:com.facebook.react.JavaScript] Loading Closure base.
2017-12-05 13:20:09.587179-0300 StatusIm[1755:195564] Loading Closure base.
2017-12-05 13:20:09.588 [info][tid:com.facebook.react.JavaScript] Shimming require
2017-12-05 13:20:09.587855-0300 StatusIm[1755:195564] Shimming require
2017-12-05 13:20:10.377936-0300 StatusIm[1755:195547] [] nw_connection_get_connected_socket 3 Connection has no connected handler
2017-12-05 13:20:10.377975-0300 StatusIm[1755:195547] TCP Conn 0x1c0164a40 Failed : error 0:61 [61]
2017-12-05 13:20:10.709350-0300 StatusIm[1755:195547] TIC TCP Conn Failed [4:0x1c4162340]: 1:61 Err(61)
2017-12-05 13:20:10.709579-0300 StatusIm[1755:195547] Task <6BA6D0FB-6F5F-459F-8D6A-AB299AF9D169>.<1> HTTP load failed (error code: -1004 [1:61])
2017-12-05 13:20:10.710073-0300 StatusIm[1755:195537] Task <6BA6D0FB-6F5F-459F-8D6A-AB299AF9D169>.<1> finished with error - code: -1004
2017-12-05 13:20:10.716 [error][tid:com.facebook.react.JavaScript] { [TypeError: Network request failed]
  line: 6335,
  column: 29,
  sourceURL: 'http://192.168.0.13.xip.io:8081/index.ios.bundle?platform=ios&dev=true&minify=false' }
2017-12-05 13:20:10.716440-0300 StatusIm[1755:195564] { [TypeError: Network request failed]
  line: 6335,
  column: 29,
  sourceURL: 'http://192.168.0.13.xip.io:8081/index.ios.bundle?platform=ios&dev=true&minify=false' }
2017-12-05 13:20:10.828 [warn][tid:com.facebook.react.JavaScript] Possible Unhandled Promise Rejection (id: 0):
error is not a function. (In 'error()', 'error' is an instance of TypeError)
http://192.168.0.13.xip.io:8081/index.ios.bundle?platform=ios&dev=true&minify=false:129458:21
tryCallOne@http://192.168.0.13.xip.io:8081/index.ios.bundle?platform=ios&dev=true&minify=false:3829:14
http://192.168.0.13.xip.io:8081/index.ios.bundle?platform=ios&dev=true&minify=false:3915:25
callTimer@http://192.168.0.13.xip.io:8081/index.ios.bundle?platform=ios&dev=true&minify=false:2142:17
callImmediatesPass@http://192.168.0.13.xip.io:8081/index.ios.bundle?platform=ios&dev=true&minify=false:2228:36
callImmediates@http://192.168.0.13.xip.io:8081/index.ios.bundle?platform=ios&dev=true&minify=false:2238:48
guard@http://192.168.0.13.xip.io:8081/index.ios.bundle?platform=ios&dev=true&minify=false:1860:7
__callImmediates@http://192.168.0.13.xip.io:8081/index.ios.bundle?platform=ios&dev=true&minify=false:2008:12
http://192.168.0.13.xip.io:8081/index.ios.bundle?platform=ios&dev=true&minify=false:1897:31
guard@http://192.168.0.13.xip.io:8081/index.ios.bundle?platform=ios&dev=true&minify=false:1860:7
callFunctionReturnFlushedQueue@http://192.168.0.13.xip.io:8081/index.ios.bundle?platform=ios&dev=true&minify=false:1895:12
callFunctionReturnFlushedQueue@[native code]
2017-12-05 13:20:10.828779-0300 StatusIm[1755:195564] Possible Unhandled Promise Rejection (id: 0):
error is not a function. (In 'error()', 'error' is an instance of TypeError)
http://192.168.0.13.xip.io:8081/index.ios.bundle?platform=ios&dev=true&minify=false:129458:21
tryCallOne@http://192.168.0.13.xip.io:8081/index.ios.bundle?platform=ios&dev=true&minify=false:3829:14
http://192.168.0.13.xip.io:8081/index.ios.bundle?platform=ios&dev=true&minify=false:3915:25
callTimer@http://192.168.0.13.xip.io:8081/index.ios.bundle?platform=ios&dev=true&minify=false:2142:17
callImmediatesPass@http://192.168.0.13.xip.io:8081/index.ios.bundle?platform=ios&dev=true&minify=false:2228:36
callImmediates@http://192.168.0.13.xip.io:8081/index.ios.bundle?platform=ios&dev=true&minify=false:2238:48
guard@http://192.168.0.13.xip.io:8081/index.ios.bundle?platform=ios&dev=true&minify=false:1860:7
__callImmediates@http://192.168.0.13.xip.io:8081/index.ios.bundle?platform=ios&dev=true&minify=false:2008:12
http://192.168.0.13.xip.io:8081/index.ios.bundle?platform=ios&dev=true&minify=false:1897:31
guard@http://192.168.0.13.xip.io:8081/index.ios.bundle?platform=ios&dev=true&minify=false:1860:7
callFunctionReturnFlushedQueue@http://192.168.0.13.xip.io:8081/index.ios.bundle?platform=ios&dev=true&minify=false:1895:12
callFunctionReturnFlushedQueue@[native code]
2017-12-05 13:20:13.504143-0300 StatusIm[1755:195547] [] nw_connection_get_connected_socket 6 Connection has no connected handler
2017-12-05 13:20:13.504274-0300 StatusIm[1755:195547] TCP Conn 0x1c0167f80 Failed : error 0:61 [61]

2017-12-05 13:20:16.618225-0300 StatusIm[1755:195543] [] nw_connection_get_connected_socket 7 Connection has no connected handler
2017-12-05 13:20:16.618266-0300 StatusIm[1755:195543] TCP Conn 0x1c0167800 Failed : error 0:61 [61]
2017-12-05 13:20:19.735413-0300 StatusIm[1755:195537] [] nw_connection_get_connected_socket 8 Connection has no connected handler
2017-12-05 13:20:19.735505-0300 StatusIm[1755:195537] TCP Conn 0x1c0167d40 Failed : error 0:61 [61]
2017-12-05 13:20:22.848930-0300 StatusIm[1755:195543] [] nw_connection_get_connected_socket 9 Connection has no connected handler
2017-12-05 13:20:22.848997-0300 StatusIm[1755:195543] TCP Conn 0x1c01663c0 Failed : error 0:61 [61]

And it goes on and on...

Can anyone report if RN 0.51.0 fixed this? I doubt it did but I haven't been able to test it yet.

Sadly it still exists.

~/Documents/Development/ReactNative/AwesomeProject$ react-native -v
react-native-cli: 2.0.1
react-native: 0.51.0

Xcode:

2017-12-07 09:19:17.996487+0000 AwesomeProject[1887:905415] TCP Conn 0x1c016c600 Failed : error 0:61 [61]
2017-12-07 09:19:20.199010+0000 AwesomeProject[1887:905411] [] nw_connection_get_connected_socket 22 Connection has no connected handler
2017-12-07 09:19:20.199120+0000 AwesomeProject[1887:905411] TCP Conn 0x1c416a140 Failed : error 0:61 [61]
2017-12-07 09:19:22.329654+0000 AwesomeProject[1887:905417] [] nw_connection_get_connected_socket 23 Connection has no connected handler
2017-12-07 09:19:22.329713+0000 AwesomeProject[1887:905417] TCP Conn 0x1c016c600 Failed : error 0:61 [61]
2017-12-07 09:19:24.472388+0000 AwesomeProject[1887:905417] [] nw_connection_get_connected_socket 24 Connection has no connected handler

Disable OS_ACTIVITY_MODE is not a good way.

At first, I run yarn start at React-native root. The crazy log goes away in simulator, but still appears in real device.

After several hours working, and read all comment again and again. I finally find @emilsjolander 878b7e4 works perfectly.

I get rid of this crazy log by comment the code in - (void)reconnect function , which inReact/RCTWebSocket/RCTReconnectingWebSockect.m.
The the crazy log go away. But it just a workaround. You won't want do this every time.

For others, I think upgrade React-native to 0.51.0 may solve this problem, seems 878b7e4 is in that branch.

It still exists.
"react": "16.2.0",
"react-native": "0.52.0",

xcode:

2018-01-10 15:54:15.635865 backgroundexample[3900:1884257] [] __nw_connection_get_connected_socket_block_invoke 146 Connection has no connected handler
2018-01-10 15:54:17.134563 backgroundexample[3900:1884258] [] __nw_connection_get_connected_socket_block_invoke 147 Connection has no connected handler
2018-01-10 15:54:17.629791 backgroundexample[3900:1884329] [] __nw_connection_get_connected_socket_block_invoke 148 Connection has no connected handler

Anyone got a workaround?? It's still happened on my iOS device.

I just implement partial workaround for this. See https://github.com/facebook/react-native/pull/17617
It adds Enable/Disable DevTools setting to In-App Developer Menu.

But unfortunate it's not enough. Especially because other websocket created in RCTPackagerConnection (funcition socketForLocation) and as I can see it can't be disabled from AppDelegate :-(

I probably can add another item to In-App Developer Menu to Enable/Disable connection to packager. What do people thinking? May be I'm missing something?

I understand this problem.....
the "nw_connection_get_connected_socket" error will not appear if you update your setting(https://github.com/facebook/react-native/issues/10027#issuecomment-261608678).

but, still you can not connect, check your smartphone and desktop are connected on same network......

Is there any movement on this error? I'm still receiving the following errors, and I'm wondering if it is having any effect on connectivity for my included framework?

Produced on RN: 51, 52 & 53, on a fresh project, promptly ejected

2018-02-26 10:35:30.461406+0000 AwesomeProject[1116:328205] NSURLConnection finished with error - code -1001
2018-02-26 10:35:30.475292+0000 AwesomeProject[1116:328202] Task <B8745B69-267D-47AB-BCE2-B4DD3C525418>.<0> HTTP load failed (error code: -999 [1:89])
2018-02-26 10:35:30.479 [info][tid:main][RCTCxxBridge.mm:210] Initializing <RCTCxxBridge: 0x1c41c6540> (parent: <RCTBridge: 0x1cc0cdc10>, executor: (null))
2018-02-26 10:35:30.483170+0000 AwesomeProject[1116:328126] Initializing <RCTCxxBridge: 0x1c41c6540> (parent: <RCTBridge: 0x1cc0cdc10>, executor: (null))
2018-02-26 10:35:30.554 [warn][tid:main][RCTBridge.m:120] Class RCTCxxModule was not exported. Did you forget to use RCT_EXPORT_MODULE()?
2018-02-26 10:35:30.554183+0000 AwesomeProject[1116:328126] Class RCTCxxModule was not exported. Did you forget to use RCT_EXPORT_MODULE()?
2018-02-26 10:35:30.578 [warn][tid:main][RCTModuleData.mm:69] Module RCTImageLoader requires main queue setup since it overrides `init` but doesn't implement `requiresMainQueueSetup`. In a future release React Native will default to initializing all native modules on a background thread unless explicitly opted-out of.
2018-02-26 10:35:30.577913+0000 AwesomeProject[1116:328126] Module RCTImageLoader requires main queue setup since it overrides `init` but doesn't implement `requiresMainQueueSetup`. In a future release React Native will default to initializing all native modules on a background thread unless explicitly opted-out of.
2018-02-26 10:35:30.657 [info][tid:main][RCTRootView.m:302] Running application AwesomeProject ({
    initialProps =     {
    };
    rootTag = 1;
})
2018-02-26 10:35:30.657524+0000 AwesomeProject[1116:328526] [] nw_connection_get_connected_socket 2 Connection has no connected handler
2018-02-26 10:35:30.657537+0000 AwesomeProject[1116:328526] TCP Conn 0x1d0360d80 Failed : error 0:61 [61]
2018-02-26 10:35:30.790 [info][tid:com.facebook.react.JavaScript] Running application "AwesomeProject" with appParams: {"rootTag":1,"initialProps":{}}. __DEV__ === true, development-level warning are ON, performance optimizations are OFF

This still exists with RN 0.52.0 and 0.54.0-rc.3.
I also observe debug mode app falling into a loop where a ton of logs regarding 'memoized props' (something like that) are spewed out to Xcode log view, device overheats (iphone 7), then app crashes.

Well, this is till an issue. iOS 11, react 0.54.

Rebinding symbol does not seem to work on device, none of the replacement methods are called. It also bothers me that there are two websockets trying to connect to localhost despite running on device.

fetch() is still not working

Was this page helpful?
0 / 5 - 0 ratings