8

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
  • 2
    I was asking and answering my own question. I searched on stackoverflow/Google when I first saw the error, saw I was the only one that saw an error on that line. After hours of debugging to build a minimum repro case, I found the brain dead stupid mistake I made, and decided to contribute a question and answer, for the sake of others who might run into this. (And I have to wait a bit longer before I'm allowed to mark the below answer as an accepted answer.) Commented Oct 10, 2015 at 2:48

1 Answer 1

21

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: Incorrect setup

Correct: Correct setup

Sign up to request clarification or add additional context in comments.

3 Comments

Thank you so much!! No idea why it would default to string, but this saved me so much headache. Thank you!
Yep, I just ran into this problem despite staring at the keys in the dictionary for the last hour. Cheers!
in Xcode 7.3.4, I was unable to change the type from string to Boolean because it was disabled. I had to use other text editor to change the type

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.