Repository navigation
Closed
Labels
BugPlatform: iOSiOS applications.iOS applications.Resolution: LockedThis issue was locked by the bot.This issue was locked by the bot.
Description
🐛 Bug Report
When opening in the app (at least in dev mode) the app will hang for a few minutes, then produce some errors then load.
Errors:
2019-03-19 02:22:37.682015-0400 demo[10073:2278776] NSURLConnection finished with error - code -1001
2019-03-19 02:22:37.698640-0400 demo[10073:2278776] Task <D45BEC27-481C-4363-AB5C-4FF04668971F>.<0> HTTP load failed (error code: -999 [1:89])
2019-03-19 02:22:37.704 [info][tid:main][RCTCxxBridge.mm:213] Initializing <RCTCxxBridge: 0x106c01290> (parent: <RCTBridge: 0x2815df5d0>, executor: (null))
2019-03-19 02:22:37.713366-0400 demo[10073:2278700] Initializing <RCTCxxBridge: 0x106c01290> (parent: <RCTBridge: 0x2815df5d0>, executor: (null))
2019-03-19 02:22:37.774 [info][tid:main][RCTRootView.m:293] Running application demo ({
initialProps = {
};
rootTag = 1;
})
2019-03-19 02:22:37.773706-0400 demo[10073:2278700] Running application demo ({
initialProps = {
};
rootTag = 1;
})
2019-03-19 02:22:37.786887-0400 demo[10073:2278777] [] nw_socket_handle_socket_event [C2.1:1] Socket SO_ERROR [61: Connection refused]
2019-03-19 02:22:37.846900-0400 demo[10073:2278777] [] nw_socket_handle_socket_event [C2.2:1] Socket SO_ERROR [61: Connection refused]
2019-03-19 02:22:37.847145-0400 demo[10073:2279213] [] nw_connection_get_connected_socket [C2] Client called nw_connection_get_connected_socket on unconnected nw_connection
2019-03-19 02:22:37.847158-0400 demo[10073:2279213] TCP Conn 0x280bd9bc0 Failed : error 0:61 [61]
2019-03-19 02:22:37.849843-0400 demo[10073:2279213] [] nw_socket_handle_socket_event [C3.1:1] Socket SO_ERROR [61: Connection refused]
2019-03-19 02:22:37.850253-0400 demo[10073:2279213] [] nw_socket_handle_socket_event [C3.2:1] Socket SO_ERROR [61: Connection refused]
2019-03-19 02:22:37.850388-0400 demo[10073:2278782] [] nw_connection_get_connected_socket [C3] Client called nw_connection_get_connected_socket on unconnected nw_connection
2019-03-19 02:22:37.850399-0400 demo[10073:2278782] TCP Conn 0x280bd9e00 Failed : error 0:61 [61]
=================================================================
Main Thread Checker: UI API called on a background thread: -[UIApplication applicationState]
PID: 10073, TID: 2279425, Thread name: com.apple.CoreMotion.MotionThread, Queue name: com.apple.root.default-qos.overcommit, QoS: 0
Backtrace:
4 libobjc.A.dylib 0x00000001adc936f4 <redacted> + 56
5 CoreMotion 0x00000001b43db688 CoreMotion + 292488
6 CoreMotion 0x00000001b43dbbb8 CoreMotion + 293816
7 CoreMotion 0x00000001b43dbac8 CoreMotion + 293576
8 CoreMotion 0x00000001b44098f8 CoreMotion + 481528
9 CoreMotion 0x00000001b440993c CoreMotion + 481596
10 CoreFoundation 0x00000001aea1f78c <redacted> + 28
11 CoreFoundation 0x00000001aea1f074 <redacted> + 276
12 CoreFoundation 0x00000001aea1a368 <redacted> + 2276
13 CoreFoundation 0x00000001aea19764 CFRunLoopRunSpecific + 452
14 CoreFoundation 0x00000001aea1a498 CFRunLoopRun + 84
15 CoreMotion 0x00000001b44092d0 CoreMotion + 479952
16 libsystem_pthread.dylib 0x00000001ae699920 <redacted> + 132
17 libsystem_pthread.dylib 0x00000001ae69987c _pthread_start + 48
18 libsystem_pthread.dylib 0x00000001ae6a1dcc thread_start + 4
2019-03-19 02:22:38.010260-0400 demo[10073:2279425] [reports] Main Thread Checker: UI API called on a background thread: -[UIApplication applicationState]
PID: 10073, TID: 2279425, Thread name: com.apple.CoreMotion.MotionThread, Queue name: com.apple.root.default-qos.overcommit, QoS: 0
Backtrace:
4 libobjc.A.dylib 0x00000001adc936f4 <redacted> + 56
5 CoreMotion 0x00000001b43db688 CoreMotion + 292488
6 CoreMotion 0x00000001b43dbbb8 CoreMotion + 293816
7 CoreMotion 0x00000001b43dbac8 CoreMotion + 293576
8 CoreMotion 0x00000001b44098f8 CoreMotion + 481528
9 CoreMotion 0x00000001b440993c CoreMotion + 481596
10 CoreFoundation 0x00000001aea1f78c <redacted> + 28
11 CoreFoundation 0x00000001aea1f074 <redacted> + 276
12 CoreFoundation 0x00000001aea1a368 <redacted> + 2276
13 CoreFoundation 0x00000001aea19764 CFRunLoopRunSpecific + 452
14 CoreFoundation 0x00000001aea1a498 CFRunLoopRun + 84
15 CoreMotion 0x00000001b44092d0 CoreMotion + 479952
16 libsystem_pthread.dylib 0x00000001ae699920 <redacted> + 132
17 libsystem_pthread.dylib 0x00000001ae69987c _pthread_start + 48
18 libsystem_pthread.dylib 0x00000001ae6a1dcc thread_start + 4
2019-03-19 02:22:49.439842-0400 demo[10073:2279213] [] nw_socket_handle_socket_event [C4.1:1] Socket SO_ERROR [61: Connection refused]
2019-03-19 02:22:49.440858-0400 demo[10073:2279213] [] nw_socket_connect [C4.2:1] connectx(8, [srcif=0, srcaddr=<NULL>, dstaddr=127.0.0.1:8081], SAE_ASSOCID_ANY, 0, NULL, 0, NULL, SAE_CONNID_ANY) failed: [61: Connection refused]
2019-03-19 02:22:49.441016-0400 demo[10073:2279213] [] nw_socket_connect [C4.2:1] connectx failed (fd 8) [61: Connection refused]
2019-03-19 02:22:49.441035-0400 demo[10073:2279213] [] nw_socket_connect connectx failed (fd 8) [61: Connection refused]
2019-03-19 02:22:49.441313-0400 demo[10073:2279490] [] nw_connection_get_connected_socket [C4] Client called nw_connection_get_connected_socket on unconnected nw_connection
2019-03-19 02:22:49.441345-0400 demo[10073:2279490] TCP Conn 0x280bcc0c0 Failed : error 0:61 [61]
2019-03-19 02:22:49.508 [info][tid:com.facebook.react.JavaScript] Running application "demo" with appParams: {"rootTag":1,"initialProps":{}}. __DEV__ === true, development-level warning are ON, performance optimizations are OFF
2019-03-19 02:22:49.508350-0400 demo[10073:2279394] Running application "demo" with appParams: {"rootTag":1,"initialProps":{}}. __DEV__ === true, development-level warning are ON, performance optimizations are OFF
To Reproduce
react-native init demoreact-native run-ios --device
Expected Behavior
App doesn't hang on boot.
Environment
React Native Environment Info:
System:
OS: macOS 10.14.4
CPU: (4) x64 Intel(R) Core(TM) i5-7500 CPU @ 3.40GHz
Memory: 24.91 MB / 8.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.13.0 - ~/.nvm/versions/node/v10.13.0/bin/node
Yarn: 1.14.0-20190123.1234 - ~/.yarn/bin/yarn
npm: 6.4.1 - ~/.nvm/versions/node/v10.13.0/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2
IDEs:
Android Studio: 3.2 AI-181.5540.7.32.5014246
Xcode: 10.2/10P107d - /usr/bin/xcodebuild
npmPackages:
react: 16.8.3 => 16.8.3
react-native: 0.59.1 => 0.59.1
Metadata
Metadata
Assignees
Labels
BugPlatform: iOSiOS applications.iOS applications.Resolution: LockedThis issue was locked by the bot.This issue was locked by the bot.
Activity
dotconnor commentedon Mar 19, 2019
Little Update:
When loading the app onto the device via
react-native run-ios --device, the app crashes after ~10s.When loading via xcode, the app loads, hangs for about ~30s then loads the app from what i'm assuming is
main.jsbundleand the not metro bundler running on my system, it then procedes to produce the same error every ~1.5s:EDIT: The above errors not relevant to the issue as noted here: #21030
dotconnor commentedon Mar 19, 2019
The issue appears to be when my system is connected to Wi-Fi and Ethernet, which are on two different networks.
If Ethernet is disabled, app works as expect, but if Ethernet is enabled, even if it has a lower network priority it doesn't connect.
There also doesn't appear to be a option to change to the IP to connect to, nor does it log the IP in xcode any more.
patrickkempff commentedon Mar 19, 2019
@dotconnor thanks for reaching out. Can you post what your AppDelegate.m looks like? Is it exactly the same as the init template?
dotconnor commentedon Mar 19, 2019
@patrickkempff Yeah, it should be the same as the template.
patrickkempff commentedon Mar 19, 2019
@dotconnor what happens when you load
http://<ip of the packager>:8081in a browser on your device? Assuming the packager uses the default port 8081dotconnor commentedon Mar 19, 2019
@patrickkempff The packager correctly binds to
0.0.0.0.Connecting to both Wi-Fi interfaces (en1 and en6 in my case) on my device returns a document (incorrect mimetype for webkit to render), contents:
But connecting to the ethernet interface (en0), results in connection error (as expected)
patrickkempff commentedon Mar 19, 2019
can you try to change:
to:
does that yield better results?
dotconnor commentedon Mar 19, 2019
Yep! That works. Thanks!
But maybe allowing to set an IP manually should be a little bit more simipler than modifing
AppDelegate.mhttps://github.com/facebook/react-native/blob/22b3528e7b5679ca34436bc032e6f1f1630d3c07/scripts/react-native-xcode.sh#L17
patrickkempff commentedon Mar 19, 2019
@dotconnor very nice 👍 If you have any idea's on how to improve this mechanism, a PR would be really awesome! Would you mind and help us all to improve this by submitting a PR? 🥇
GreenRidingHood commentedon May 23, 2019
thank you @patrickkempff that solved. sorry @dotconnor i didnt understand your solution, i dont have much xcode or RN knowledge (yet :) )
DataGreed commentedon Aug 12, 2019
@patrickkempff which IP should I use if I debug on my device via a cable from xcode?