XCFramework fails to Archive when Apple Network framework is imported and XCFramework target is below iOS 12

Originator:martin.acg
Number:rdar://FB9360419 Date Originated:July 19th 2021
Status:Open Resolved:
Product:Xcode Product Version:13 beta 3 (13A5192j)
Classification: Reproducible:
 
I have a project which I package as an XCFramework successfully using Xcode 12.5.1; this project’s target is iOS 9.0 and I import the Network framework in some classes and conditionally use it depending on the host app’s iOS version.
When I try to package the XCFramework using Xcode 13 beta 3 (failed also with beta 1 and 2) I get these errors:

-num-threads 12 -output-filelist /var/folders/3y/6wknq7r11zs_31zl7xqd4z5m0000gn/T/TemporaryDirectory.fdcuew/outputs-1
/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/Network.swiftmodule/i386-apple-ios-simulator.swiftinterface:1254:19: error: 'NWConnection' is only available in iOS 12.0 or newer
extension Network.NWConnection {
                  ^
/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/Network.swiftmodule/i386-apple-ios-simulator.swiftinterface:1254:1: note: add @available attribute to enclosing extension
extension Network.NWConnection {
^
/ReachabilityMonitor.swift:9:8: error: failed to build module 'Network'; this SDK is not supported by the compiler (the SDK is built with 'Apple Swift version 5.5 (swiftlang-1300.0.24.14 clang-1300.0.25.10)', while this compiler is 'Apple Swift version 5.5 (swiftlang-1300.0.24.13 clang-1300.0.25.10)'). Please select a toolchain which matches the SDK.
import Network
       ^
/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/Network.swiftmodule/i386-apple-ios-simulator.swiftinterface:1254:19: error: 'NWConnection' is only available in iOS 12.0 or newer
extension Network.NWConnection {
                  ^
/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk/usr/lib/swift/Network.swiftmodule/i386-apple-ios-simulator.swiftinterface:1254:1: note: add @available attribute to enclosing extension
extension Network.NWConnection {
^

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!