Some background, in our iOS project we have a dependency on RestKit, an outdated networking and request mapping library. It has its own dependency on AFNetworking, another outdated library, but it has vendored the files in a subfolder (so no versioning on that at all). Since iOS 26 it has been giving an error in the file RestKit/Network/AFHTTPClient.m namely:
"Use of private header from outside its module: 'netinet6/in6.h'"
I have tried dealing with this in several ways. The first thought was to simply remove the offending line, this works and no other errors pop up. However the included file defines a bunch of constants related to networking that I prefer not to change without understanding them first. The inclusion also depends on _SYSTEM_CONFIGURATION being defined, so I figured if I can somehow configure the build to not define that, it will skip including the header with no changes to the code. This define seemingly controls the addition of reachability to the framework, which we don’t use through this library, so it would be fine to miss that functionality. Finally, the header is a system header and I’m almost certain there must be a way to include it anyway, albeit with specific build parameters.
When I remove the line, everything seems to work fine. So any confirmation/explanation that it’s fine to remove would be an acceptable answer. The file also includes netinet/in.h and there seems to be logic to prevent including netinet6/in6.h directly. This could very well be an incorrect include regardless of iOS 26.
It seems the _SYSTEM_CONFIGURATION define is added when the optional SystemConfiguration framework is included, removing it does get rid of the error when building standalone, but not when including the dependency in the project. A reproducible way of removing that framework that keeps the error away even in the project that includes this lib would also be an acceptable answer.
I have also tried to wrestle with the modulemap for a bit. Technically I should be able to tell clang that it’s all good by configuring the modulemap file, but I’m not versed enough in clang’s syntax and options to come up with a fix. A working modulemap example that I can use to get rid of the error would also be acceptable as an answer. I read that when the library is a system framework it should be allowed, but Xcode is not having it, spitting out more errors about the invalid modulemap on top of the original error.
I am currently investigating disabling the error with -Wno-private-header, but I can’t seem to get it to work. Either I’m using the wrong flags fields or the option doesn’t work to disable this error.
On the off chance someone knows of a good replacement, that would also be acceptable. But I’ve looked to replace this thing many times before and our equally outdated API format being JSON-like but not quite valid JSON makes this one of the only working solutions for mapping our entities (which is all we use it for, really).
What is the best approach?
Restkit:
https://github.com/restkit/restkit
Offending file: