You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my company, we use Carthage (actually Fastlane Carthage) to generate xcframework for our internal SDKs, which works fine before Xcode 14.
However, when we upgraded to Xcode 14, only iOS SDKs worked, and every other multi-platform SDK (e.g the SecurityKit below has iOS and watchOS) failed as an Archive step.
When deep into the issue, I've found that Carthage is using flag sdk to archive the scheme. As Apple's recommendation:
The system determines the architectures and SDK according to build settings when running the command with the -destination flag, like the example above. Avoid common errors by using this flag rather than -arch and -sdk.
To build an archive for a different platform, adjust the value for -destination. Replacing this value with "generic/platform=iOS Simulator" creates an archive for Simulator.
I've tried replacing -sdk with -destination, and it worked well.
Fastlane Carthage config script
desc"Build and package binary framework"lane:build_package_frameworkdo |options|
if !options[:framework]raise"No framework parameter specified".redendframework=options[:framework]carthage(command: "build",no_skip_current: true,use_xcframeworks: true,)zip(path: "Carthage/Build/#{framework}.xcframework",output_path: "#{framework}.xcframework.zip",verbose: false,)end
which is equivalent carthage build --use-xcframeworks no-skip-current with all platforms
Carthage Output
error: Multiple commands produce '/Users/MYNAME/Library/Developer/Xcode/DerivedData/SecurityKit-csytdjtnwyszdkfbdfemtegbbzis/Build/Intermediates.noindex/ArchiveIntermediates/SecurityKit-watchOS/IntermediateBuildFilesPath/UninstalledProducts/watchos/Alamofire.framework' note: Target 'Alamofire-iOS' (project 'Pods') has create directory command with output '/Users/MYNAME/Library/Developer/Xcode/DerivedData/SecurityKit-csytdjtnwyszdkfbdfemtegbbzis/Build/Intermediates.noindex/ArchiveIntermediates/SecurityKit-watchOS/IntermediateBuildFilesPath/UninstalledProducts/watchos/Alamofire.framework' note: Target 'Alamofire-watchOS' (project 'Pods') has create directory command with output '/Users/MYNAME/Library/Developer/Xcode/DerivedData/SecurityKit-csytdjtnwyszdkfbdfemtegbbzis/Build/Intermediates.noindex/ArchiveIntermediates/SecurityKit-watchOS/IntermediateBuildFilesPath/UninstalledProducts/watchos/Alamofire.framework'error: Multiple commands produce '/Users/MYNAME/Library/Developer/Xcode/DerivedData/SecurityKit-csytdjtnwyszdkfbdfemtegbbzis/Build/Intermediates.noindex/ArchiveIntermediates/SecurityKit-watchOS/IntermediateBuildFilesPath/UninstalledProducts/watchos/APICoreKit.framework' note: Target 'APICoreKit-iOS' (project 'Pods') has create directory command with output '/Users/MYNAME/Library/Developer/Xcode/DerivedData/SecurityKit-csytdjtnwyszdkfbdfemtegbbzis/Build/Intermediates.noindex/ArchiveIntermediates/SecurityKit-watchOS/IntermediateBuildFilesPath/UninstalledProducts/watchos/APICoreKit.framework' note: Target 'APICoreKit-watchOS' (project 'Pods') has create directory command with output '/Users/MYNAME/Library/Developer/Xcode/DerivedData/SecurityKit-csytdjtnwyszdkfbdfemtegbbzis/Build/Intermediates.noindex/ArchiveIntermediates/SecurityKit-watchOS/IntermediateBuildFilesPath/UninstalledProducts/watchos/APICoreKit.framework'error: Multiple commands produce '/Users/MYNAME/Library/Developer/Xcode/DerivedData/SecurityKit-csytdjtnwyszdkfbdfemtegbbzis/Build/Intermediates.noindex/ArchiveIntermediates/SecurityKit-watchOS/IntermediateBuildFilesPath/UninstalledProducts/watchos/AFNetworking.framework' note: Target 'AFNetworking' (project 'Pods') has create directory command with output '/Users/MYNAME/Library/Developer/Xcode/DerivedData/SecurityKit-csytdjtnwyszdkfbdfemtegbbzis/Build/Intermediates.noindex/ArchiveIntermediates/SecurityKit-watchOS/IntermediateBuildFilesPath/UninstalledProducts/watchos/AFNetworking.framework' note: Target 'AFNetworking.root-NSURLSession-Security-Serialization' (project 'Pods') has create directory command with output '/Users/MYNAME/Library/Developer/Xcode/DerivedData/SecurityKit-csytdjtnwyszdkfbdfemtegbbzis/Build/Intermediates.noindex/ArchiveIntermediates/SecurityKit-watchOS/IntermediateBuildFilesPath/UninstalledProducts/watchos/AFNetworking.framework'
which carthage
: /Users/MYNAME/bin/carthagecarthage version
: 0.39.0xcodebuild -version
: Test from 14.0 to 14.2--no-build
: No--no-use-binaries
: No--use-submodules
: No--cache-builds
: No--new-resolver
: No--use-xcframeworks
: YesIn my company, we use Carthage (actually Fastlane Carthage) to generate xcframework for our internal SDKs, which works fine before Xcode 14.
However, when we upgraded to Xcode 14, only iOS SDKs worked, and every other multi-platform SDK (e.g the SecurityKit below has iOS and watchOS) failed as an Archive step.
When deep into the issue, I've found that Carthage is using flag
sdk
to archive the scheme. As Apple's recommendation:I've tried replacing
-sdk
with-destination
, and it worked well.Fastlane Carthage config script
which is equivalent
carthage build --use-xcframeworks no-skip-current
with all platformsCarthage Output
Actual outcome
Expected outcome
When archive scheme, it should use
-destination
instead of-sdk
The text was updated successfully, but these errors were encountered: