'Foundation/NSURLHandle.h' file not found

When I build my app for my real device I get this error

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURL.h:10:9 'Foundation/NSURLHandle.h' file not found

I have latest macOS (13.5.2 (22G91)) and the latest Xcode (14.3.1 (14E300c)). I got this issue about 5 months now, even on my old Intel mac. My new M1 mac was not restored by a Backup and I still get this issue.

Can someone please give me a hint or advice to get this issue fixed?

NSURLHandle was deprecated many moons ago and isn’t part of the iOS SDK. The fact that Foundation’s top-level header is trying to include it suggests there’s something wrong with the way that your project is configured, that is, it’s using the iOS Foundation framework with macOS conditionals.

If you create a new project from one of the built-in templates, does that reproduce the problem?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Thanks for the reply. I found in my .zshrc that CPLUS_INCLUDE_PATH was modified. I assume new Projects would also failed to build. However, I removed the line now and everything works again :)

'Foundation/NSURLHandle.h' file not found
 
 
Q