nw_host_stats_add_src recv too small, received 24, expected 28

喜夏-厌秋 提交于 2019-12-17 18:25:17

问题


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.

Thanks!


回答1:


This is a bug with logs in 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).

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.




回答2:


Cause: iOS 10 & Xcode 8. Also can be replicated by an odd inputField bug:

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

Link to the above fix and reasoning

Or just silence everything:

  • Press ⌘<
  • Edit simulator scheme by adding or setting the OS_ACTIVITY_MODE under Environment Variables in the Run Arguments to a value of disable.
  • Do the same for the device but remove the value for OS_ACTIVITY_MODE , leaving it empty. The logs will display for the device as they should.



回答3:


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/

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".

This appears to suppress all of the "nw_" warning messages. Note that this just suppresses the 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.

How to edit a Scheme's Run Environmental Variables section in XCode

Adding the OS_ACTIVITY_MODE value of "disable"




回答4:


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.



来源:https://stackoverflow.com/questions/41273773/nw-host-stats-add-src-recv-too-small-received-24-expected-28

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!