9

反应原生 0.61

我试图找出我在 XCode 或我的 iPhone 中破坏了某些东西的地方。几天前一切正常 - 我按下运行 -> 构建成功 -> 一切都通过 wifi 工作(热重载)。

但是今天当我按下运行时 - 构建成功但它没有启动应用程序。重复运行后,一个应用程序正在启动,但没有连接到 Metro Builder。

我尝试在另一个办公室使用相同的组合。那里一切正常。

任何 Android 设备上的应用程序正在完美启动并连接到 Metro Builder。所有模拟器(包括通过 XCode)都运行良好。相同的无线网络。

XCode 中的输出:

2020-01-30 01:20:57.299821+0200 TestApp[417:22121] Task <6DD1500D-484C-4290-9543-30284F360671>.<1> finished with error [-1001] Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo={NSUnderlyingError=0x280250060 {Error Domain=kCFErrorDomainCFNetwork Code=-1001 "(null)" UserInfo={_kCFStreamErrorCodeKey=-2102, _kCFStreamErrorDomainKey=4}}, NSErrorFailingURLStringKey=http://192.168.1.70:8081/status, NSErrorFailingURLKey=http://192.168.1.70:8081/status, _kCFStreamErrorDomainKey=4, _kCFStreamErrorCodeKey=-2102, NSLocalizedDescription=The request timed out.}

2020-01-30 01:20:57.337180+0200 TestApp[417:22123] Task <6DD1500D-484C-4290-9543-30284F360671>.<1> HTTP load failed, 0/0 bytes (error code: -999 [1:89])

2020-01-30 01:20:57.367 [info][tid:main][RCTRootView.m:293] Running application TestApp ({
    initialProps =     {
    };
    rootTag = 1;
})

2020-01-30 01:20:57.428562+0200 TestApp[417:22122] [] nw_socket_handle_socket_event [C2.1:1] Socket SO_ERROR [61: Connection refused]

2020-01-30 01:20:57.429765+0200 TestApp[417:22122] [] nw_socket_handle_socket_event [C2.2:1] Socket SO_ERROR [61: Connection refused]

2020-01-30 01:20:57.430440+0200 TestApp[417:22121] [] nw_connection_get_connected_socket [C2] Client called nw_connection_get_connected_socket on unconnected nw_connection

2020-01-30 01:20:57.430482+0200 TestApp[417:22121] TCP Conn 0x283904f00 Failed : error 0:61 [61]

2020-01-30 01:20:57.434875+0200 TestApp[417:22121] [] nw_socket_handle_socket_event [C3.1:1] Socket SO_ERROR [61: Connection refused]

2020-01-30 01:20:57.435620+0200 TestApp[417:22121] [] nw_socket_handle_socket_event [C3.2:1] Socket SO_ERROR [61: Connection refused]

2020-01-30 01:20:57.435873+0200 TestApp[417:22122] [] nw_connection_get_connected_socket [C3] Client called nw_connection_get_connected_socket on unconnected nw_connection

2020-01-30 01:20:57.435906+0200 TestApp[417:22122] TCP Conn 0x283906100 Failed : error 0:61 [61]

2020-01-30 01:20:57.572 [warn][tid:com.facebook.react.JavaScript] Warning: AsyncStorage has been extracted from react-native core and will be removed in a future release. It can now be installed and imported from '@react-native-community/async-storage' instead of 'react-native'. See https://github.com/react-native-community/react-native-async-storage

2020-01-30 01:20:57.634403+0200 TestApp[417:22123] [] nw_socket_handle_socket_event [C4.1:1] Socket SO_ERROR [61: Connection refused]

2020-01-30 01:20:57.634990+0200 TestApp[417:22123] [] nw_socket_handle_socket_event [C4.2:1] Socket SO_ERROR [61: Connection refused]

2020-01-30 01:20:57.635253+0200 TestApp[417:22121] [] nw_connection_get_connected_socket [C4] Client called nw_connection_get_connected_socket on unconnected nw_connection

2020-01-30 01:20:57.635296+0200 TestApp[417:22121] TCP Conn 0x283910180 Failed : error 0:61 [61]

2020-01-30 01:20:57.780 [info][tid:com.facebook.react.JavaScript] Running "TestApp" with {"rootTag":1,"initialProps":{}}

2020-01-30 01:20:57.912 [info][tid:com.facebook.react.WebSocketModuleQueue][RCTSRWebSocket.m:518] SocketRocket: In debug mode.  Allowing connection to any root cert

我什至尝试只使用一个新项目进行测试 - react-native init,我遇到了同样的问题。

我应该在哪里检查?

4

1 回答 1

-1

转到 XCode 并检查构建日志。这可能是您的 JS 中的一些语法问题。

于 2020-02-06T23:21:38.127 回答