我要分发的 iOS SDK 由一个框架组成,该框架在其 Frameworks 文件夹中有其他框架。我想将最外面的框架转换为 XCFramework 进行分发。为此,首先我使用以下命令归档框架:
xcodebuild archive \
-scheme "MySDK" \
-destination "generic/platform=iOS" \
-archivePath ../output/MySDK-iOS \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES \
-workspace "MyWorkspace.xcworkspace"
xcodebuild archive \
-scheme "MySDK" \
-destination "generic/platform=iOS Simulator" \
-archivePath ../output/MySDK-Sim \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES \
-workspace "MyWorkspace.xcworkspace"
结果,在存档的包内容中,我看到内部框架和主框架都已创建并列在 Products->Library->Frameworks 下。我尝试使用以下命令创建 xcframework:
xcodebuild -create-xcframework \
-framework ./MySDK-iOS.xcarchive/Products/Library/Frameworks/MySDK.framework \
-framework ./MySDK-Sim.xcarchive/Products/Library/Frameworks/MySDK.framework \
-output ./MySDK.xcframework
我得到错误:
The CodingKeys(stringValue: "SupportedPlatform", intValue: nil) is empty in library -arm64_armv7.
如何在此设置中创建 XCFramework 而不会出错?