I've managed to build this locally via xcode but when trying to create xcframeworks of this, I am unable to create a simulator archive to add to the xcframework.
Framework B has Excluded Architectures = [x86_64, arm64]
for 'Any iOS Simulator SDK'
Framework A imports Framework B but has Exclude Source File Names = FrameworkB.framework, FrameworkB.xcframework]
for Any iOS Simulator SDK'
So when using xcodebuild command
/usr/bin/xcodebuild clean archive \
-scheme FrameworkB \
-archivePath PATH/FrameworkB-iphoneos.xcarchive \
-configuration Release \
-sdk iphoneos \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES \
BUILD_DIR=PATH/build \
DEVELOPMENT_TEAM=TEAMID \
GCC_PREPROCESSOR_DEFINITIONS=""\
SWIFT_ACTIVE_COMPILATION_CONDITIONS=""
/usr/bin/xcodebuild clean archive \
-scheme FrameworkB \
-archivePath PATH/FrameworkB-iphonesimulator.xcarchive \
-configuration Release \
-sdk iphonesimulator \
-destination='generic/platform=iOS Simulator' \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES \
BUILD_DIR=PATH/build \
DEVELOPMENT_TEAM=TEAMID \
GCC_PREPROCESSOR_DEFINITIONS=""\
SWIFT_ACTIVE_COMPILATION_CONDITIONS=""
/usr/bin/xcodebuild -create-xcframework \
-framework PATH/FrameworkB-iphoneos.xcarchive/Products/Library/Frameworks/FrameworkB.framework \
-framework PATH/FrameworkB-iphonesimulator.xcarchive/Products/Library/Frameworks/FrameworkB.framework \
-output PATH/FrameworkB.xcframework
In the clean archive step for iOS Simulator I get
warning: None of the architectures in ARCHS (arm64, x86_64) are valid. Consider setting ARCHS to $(ARCHS_STANDARD) or updating it to include at least one value from VALID_ARCHS (arm64, arm64e, i386, x86_64) which is not in EXCLUDED_ARCHS (arm64, x86_64).
As I've excluded both them archs. This fails to produce a binary inside the xcarchive though. Which leads to
error: unable to read the file at 'PATH/FrameworkB-iphonesimulator.xcarchive/Products/Library/Frameworks/FrameworkB.framework/FrameworkB'
I would like to avoid all of this but this is the only way I've managed to get the project to build for arm64 simulator with the new M1 Macs.
Before FrameworkB built using x86_64 but contains libraries which don't support arm64. I have to exclude both archs though since Exclude Source File Names
you can only specify Any iOS Simulator SDK
rather than Only ARM64 iOS Simulator
.
I've tried Excluding FrameworkB when importing the xcframework but I get While building for iOS Simulator, no library for this platform was found
As I've excluded both them archs. This fails to produce a binary inside the xcarchive though
Right -- you excluded all of the architectures that would be in the binary, so there's nothing left. What lead you to needing to exclude architectures at all? That is nearly always wrong. Technote 3117 goes into depth on the details.