我有一个通过 SPM 添加 RxSwift 依赖项的框架,当尝试通过以下脚本存档我的框架时:
xcodebuild archive \
-project Project.xcodeproj \
-scheme Scheme \
-destination "generic/platform=iOS" \
-archivePath "archives/Release-iOS" \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES \
它失败了:
** ARCHIVE FAILED **
The following build commands failed:
SwiftVerifyEmittedModuleInterface normal arm64 Verifying\ emitted\ module\ interface\ RxCocoa.private.swiftinterface /Users/.../DerivedData/Project-ericldteywlbdydxfxsgvkaxpvdj/Build/Intermediates.noindex/ArchiveIntermediates/Project/IntermediateBuildFilesPath/RxSwift.build/Release-iphoneos/RxCocoa.build/Objects-normal/arm64/RxCocoa.private.swiftinterface (in target 'RxCocoa' from project 'RxSwift')
SwiftVerifyEmittedModuleInterface normal arm64 Verifying\ emitted\ module\ interface\ RxCocoa.swiftinterface /Users/.../DerivedData/Project-ericldteywlbdydxfxsgvkaxpvdj/Build/Intermediates.noindex/ArchiveIntermediates/Project/IntermediateBuildFilesPath/RxSwift.build/Release-iphoneos/RxCocoa.build/Objects-normal/arm64/RxCocoa.swiftinterface (in target 'RxCocoa' from project 'RxSwift')
(2 failures)
如果通过 Xcode 完成(产品 -> 存档),它确实会成功,但 Xcode 似乎没有在后面使用 xcodebuild 来存档它,所以很难比较。
我正在使用 Xcode 14.3.1 和最新版本的 RxSwift 6.6.0。
尝试一下:
xcodebuild archive \
-project Project.xcodeproj \
-scheme Scheme \
-destination "generic/platform=iOS" \
-archivePath "archives/Release-iOS" \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES \
OTHER_SWIFT_FLAGS="-no-verify-emitted-module-interface"