React Native 无限流的Socket SO_ERROR [英] React Native endless stream of Socket SO_ERROR

查看:44
本文介绍了React Native 无限流的Socket SO_ERROR的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理一个现有的 React Native 项目,在 XCode 日志输出中,我收到了源源不断的以下错误

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

我怎样才能弄清楚这个错误是从哪里来的?它似乎没有影响应用程序,但我想了解这个问题.我怀疑这不是应用程序的 JavaScript 代码,而是正在使用的 Pod 之一:

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'

推荐答案

  1. 选择 XCode10 构建系统:在 Xcode 中转到 File -> Project Settings(或 Workspace settings) -> Build system,在其中更改New Build SystemLegacy Build System.
  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.

在此处输入图片说明

  1. 临时修复:Edit Scheme => Run => Environment Variables => 在 XCode 中添加 OS_ACTIVITY_MODE:disable.
  1. Temporary fix: Edit Scheme => Run => Environment Variables => Add OS_ACTIVITY_MODE:disable in the XCode.

注意:这很好用,但请记住,它还会抑制调试可能需要的所有 NSLog 输出.

Note: This works fine, but keep in mind that it also suppresses all NSLog output you may need for debugging.

在此处输入图片说明

这篇关于React Native 无限流的Socket SO_ERROR的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆