反应套接字SO_ERROR的本机无尽流

时间:2019-01-09 12:24:57

标签: xcode react-native react-native-ios

我正在处理一个现有的React Native项目,并且在XCode日志输出中,我得到了以下错误的无尽流

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

我该如何找出错误的出处?它似乎并没有影响应用程序,但我想了解这个问题。我怀疑这不是应用程序的JavaScript代码,而是所使用的Pod之一:

pod 'Firebase/Core'
pod 'Firebase/Messaging'
pod 'Firebase/Crash'

3 个答案:

答案 0 :(得分:1)

GitHub上有一个关于此的主题,它与iOS 12+和Xcode 10+相关
https://github.com/facebook/react-native/issues/19573

我试图更改buildSystem,它对我有用:

  • 转到File,然后依次转到Project SettingsWorkspace Settings
  • 从构建系统下拉列表中选择Legacy Build System

enter image description here

答案 1 :(得分:0)

  1. 要选择XCode10构建系统,请执行以下操作: 在Xcode中,转到File-> Project Settings(或Workspace settings)-> Build system,在其中将New Build System更改为Legacy Build System

enter image description here

  1. 临时修复: Edit Scheme => Run => Environment Variables =>添加OS_ACTIVITY_MODE:在XCode中禁用。

注意:这可以正常工作,但请记住,它还会隐藏您可能需要调试的所有NSLog输出。

enter image description here

答案 2 :(得分:0)

如果您在ios上运行您的应用程序: 1.转到ios / APP_NAME / Info.plist 2.将这两个条目添加到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>