I'm developing a multi-platform SDK in Xcode following the instructions from Creating a multiplatform binary framework bundle. I've done this several times in the past the only issue being that I need to explicitly pass SUPPORTS_MACCATALYST=YES
in the xcconfig. This time, however, I am getting the following error while running xcodebuild -create-xcframework
:
A library with the identifier 'ios-arm64' already exists.
After adding and removing frameworks, I've determined that my Catalyst build is producing an iOS build despite being passed -destination "generic/platform=macOS,variant=Mac Catalyst"
. Two supporting pieces of evidence are:
Versions/A
and symlinks./usr/libexec/PlistBuddy -c 'Print :CFBundleSupportedPlatforms' Info.plist
produces iPhoneOS
rather than MacOSX
.It could be further verified by looking in derived data and the folders used in the build log.
I'm wondering why a new project would have this issue but my existing ones don't.
I was able to trace this to a new setting that's automatically applied by Xcode 15, ALLOW_TARGET_PLATFORM_SPECIALIZATION
or "Allow Multi-Platform Builds".
Per the summary:
If enabled, allows targets to build multiple times within a single build operation. Targets will build for the platform of the active run destination, as well as the platforms of any targets which depend on them.
I'm not exactly sure why, but when xcodebuild
encounters this field, it ignores the destination in favor of iOS.
Clearing the setting fixed my build.