CFNetwork internal error: CFNetworkInternal.h:478

偶尔善良 提交于 2019-12-23 08:50:15

问题


My iOS device logs (on simulator and real devices) was filled with a couple dozen lines of the following error spam:

CFNetwork internal error (0xc01a:/BuildRoot/Library/Caches/com.apple.xbs/Sources/CFNetwork_Sim/CFNetwork-758.0.2/ProjectRuntime/CFNetworkInternal.h:478)

Why am I seeing these, and how do I get rid of them?


回答1:


Turns out this was due to an incorrect setup in my Info.plist's NSAppTransportSecurity.

Make sure that for each of the NSExceptionDomains you use, the subfields of the dictionary (such as NSIncludesSubdomains, NSExceptionRequiresForwardSecrecy, and NSExceptionAllowsInsecureHTTPLoads) are set to type Boolean, not String. While XCode may display your values of YES and NO very similarly, the type is important for ensuring CFNetwork is able to understand your config without any errors.

Incorrect:

Correct:



来源:https://stackoverflow.com/questions/33025929/cfnetwork-internal-error-cfnetworkinternal-h478

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