xcode nw_host_stats_add_src recv 太小,收到 24,预期 28
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/41273773/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
nw_host_stats_add_src recv too small, received 24, expected 28
提问by Haris
nw_host_stats_add_src recv too small, received 24, expected 28
So I'm getting this appear in the console and I'm not sure whether it is an issue that I should be bothered about or not. I noticed it after attaching my app to Firebase and writing to the database with anonymous sign in. Just wondering whether I need to do anything about this and if so what those actions would be.
所以我让这个出现在控制台中,我不确定这是否是我应该关心的问题。在将我的应用程序附加到 Firebase 并使用匿名登录写入数据库后,我注意到了它。只是想知道我是否需要对此做任何事情,如果需要,这些操作会是什么。
Thanks!
谢谢!
回答by Igor
This is a bug with logs in Xcode8 + iOS10.
这是 Xcode8 + iOS10 中的日志错误。
We can get round it in this way:
我们可以这样绕过它:
When on simulator, add the Name OS_ACTIVITY_MODE
and the Value
Variables disable
and check it (Product -> Scheme -> Edit Scheme -> Run -> Arguments -> Environment).
在模拟器上时,添加名称OS_ACTIVITY_MODE
和值变量disable
并检查它(产品 -> 方案 -> 编辑方案 -> 运行 -> 参数 -> 环境)。
When on device, only add OS_ACTIVITY_MODE
and check it(don't add the Value). You'll see the NSLog in the Xcode8 Console.
在设备上时,只添加OS_ACTIVITY_MODE
和检查它(不要添加值)。您将在 Xcode8 控制台中看到 NSLog。
回答by Luke S
Cause: iOS 10 & Xcode 8. Also can be replicated by an odd inputField bug:
原因:iOS 10 和 Xcode 8。也可以通过一个奇怪的 inputField 错误复制:
Issue belongs to an InputField whom width is smaller than the inputs chars : 96px vs (4 * 28px) This leads to a 100% CPU and it is fixed when width is set to 128px
问题属于宽度小于输入字符的 InputField :96px vs (4 * 28px) 这导致 100% CPU 并且在宽度设置为 128px 时固定
Link to the above fix and reasoning
Or just silence everything:
或者只是沉默一切:
- Press ?<
- Edit simulatorscheme by adding or setting the
OS_ACTIVITY_MODE
under Environment Variables in the Run Arguments to a value ofdisable
. - Do the same for the devicebut remove the value for
OS_ACTIVITY_MODE
, leaving it empty. The logs will display for the device as they should.
- 按 ?<
- 通过在运行参数中添加或设置下环境变量为值来编辑模拟器方案。
OS_ACTIVITY_MODE
disable
- 对设备执行相同操作,但删除 的值
OS_ACTIVITY_MODE
,将其留空。日志将按其应有的方式显示设备。
回答by spencery2
I found this answer in a video on Reddit located here: https://www.reddit.com/r/ios/comments/5p0fvy/xcode_nw_host_stats_add_src_recv_too_small/
我在 Reddit 上的视频中找到了这个答案:https: //www.reddit.com/r/ios/comments/5p0fvy/xcode_nw_host_stats_add_src_recv_too_small/
This warning comes from XCode and can be disabled by adding an Environmental variable to the Scheme's Run section. The Environmental name is OS_ACTIVITY_MODE and the value is "disable".
此警告来自 XCode,可以通过向 Scheme 的 Run 部分添加环境变量来禁用。环境名称为 OS_ACTIVITY_MODE,值为“禁用”。
This appears to suppress all of the "nw_" warning messages. Note that this just suppressesthe warnings. I'm not sure if the warnings are significant or not or whether this indicates that there are "real" underlying problems that should be fixed.
这似乎抑制了所有“nw_”警告消息。请注意,这只会抑制警告。我不确定警告是否重要,或者这是否表明存在应该修复的“真实”潜在问题。
How to edit a Scheme's Run Environmental Variables section in XCode
如何在 XCode 中编辑 Scheme 的运行环境变量部分
回答by Alex
I was getting this exact same error message on Xcode-8.2 iOS-10.2, but I was not using Firebase, so I'm not sure if that makes a difference. Setting OS_ACTIVITY_MODE
to disable
did not solve the problem, however, I realized it was coming from the All Exceptions Breakpoint
I had set. I changed it to from All
to Objective-C
(removing C
) and it no longer stops on that line anymore. You can do this by right-clicking on breakpoint in the breakpoints tab on the left, then selecting edit, then making the change.
我在 Xcode-8.2 iOS-10.2 上收到完全相同的错误消息,但我没有使用 Firebase,所以我不确定这是否有所不同。设置OS_ACTIVITY_MODE
为disable
并没有解决问题,但是,我意识到它来自All Exceptions Breakpoint
我设置的。我把它改为从All
到Objective-C
(删除C
),并不再在该行停止了。您可以通过右键单击左侧断点选项卡中的断点,然后选择编辑,然后进行更改来完成此操作。