Search code examples
xcodewebkitxcode15

Xcode 15 - No dependency on Webkit, yet build errors on new a WebKit API


Our application consists of several modules & the application. None of these modules nor the application has WebKit as a dependency.

One module does have a dependency to a closed-source Swift-framework that, on itself, has a dependency to WebKit (based on the swiftinterface).

The dependency itself has been build with Swift 5.5 with BUILD_LIBRARY_FOR_DISTRIBUTION-flag enabled.
We import this module using @_implementationOnly import Foo & our module also has the BUILD_LIBRARY_FOR_DISTRIBUTION-flag enabled.

If we clean the build-folder in Xcode, then build the application, our app does compile.
However, the next time we make a (incremental) build after that, it results in a WebKit build error Could not build Objective-C module 'WebKit.

The following log is outputted:

<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "Headers/WebKit.h"
        ^
/Applications/Xcode-15.0.0.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator17.0.sdk/System/Library/Frameworks/WebKit.framework/Headers/WebKit.h:66:9: note: in file included from /Applications/Xcode-15.0.0.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator17.0.sdk/System/Library/Frameworks/WebKit.framework/Headers/WebKit.h:66:
#import <WebKit/WKWebsiteDataStore.h>
        ^
/Applications/Xcode-15.0.0.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator17.0.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKWebsiteDataStore.h:120:47: error: no type or protocol named 'nw_proxy_config_t'
@property (nullable, nonatomic, copy) NSArray<nw_proxy_config_t> *proxyConfigurations NS_REFINED_FOR_SWIFT API_AVAILABLE(macos(14.0), ios(17.0));
                                              ^
<unknown>:0: error: could not build Objective-C module 'WebKit'

We never have encountered this problem before & it works fine when compiling with Xcode 14.3.1.
I've been trying to tackle this issue since the 15.0 RC release and I cannot find a solution for this. Does anyone know how to fix this issue?


Solution

  • This seems an issue with running Xcode 15 on macOS 13, updating to Sonoma (macOS 14) fixed this issue.