I'm using swift-create-xcframework to create an XCFramework from my Swift package. I have combed through the source code and I don't think this tool is the problem, though it will obviously need to be updated with whatever the solution is, since it is what calls into xcodebuild.
Anyway, my package has one explicit dependency, which itself does not specify a minimum deployment target. xcodebuild is assuming a deployment target of 18.1 for that dependency, which is the highest Xcode 16.1 supports.
From the build output, note the 18.1 target:
WriteAuxiliaryFile /…/DerivedData/…/Jsum.build/Release-iphoneos/CEcho.build/Objects-normal/arm64/…-common-args.resp (in target 'CEcho' from project 'Jsum')
cd /Users/tanner/Repos/Jsum
write-file /…/DerivedData/…/Jsum.build/Release-iphoneos/CEcho.build/Objects-normal/arm64/…-common-args.resp
-target arm64-apple-ios18.1 -fpascal-strings -Os '-DSWIFT_PACKAGE=1' …
And the error:
EmitSwiftModule normal arm64 (in target 'Jsum' from project 'Jsum')
cd /Users/tanner/Repos/Jsum
/Applications/Xcode-16.1.0.app/…/swift-frontend …
/…/EchoExtensions.swift:10:8: error: compiling for iOS 12.0, but module 'Echo' has a minimum deployment target of iOS 18.1: /…/Jsum/.build/swift-create-xcframework/build/Release-iphoneos/Echo.framework/Modules/Echo.swiftmodule/arm64-apple-ios.swiftmodule
import Echo
^
I might have opened an issue on the repo for this tool, but it is a corporate published tool and they have issues turned off. I'm hoping someone here knows what I can do instead.
I tried passing this argument for xcodebuild I thought might help to no avail:
--xc-setting OTHER_SWIFT_FLAGS="-target arm64-apple-ios12.0"
Here is the full command I'm running, sans the above argument:
swift create-xcframework --platform ios > build.log
If you want to help debug this, installing the tool is simple:
brew install segment-integrations/formulae/swift-create-xcframework
Edit: solution: --xc-setting IPHONEOS_DEPLOYMENT_TARGET=12.0