我在 UIKit for Mac 上为 libsodium 创建了 xcframework:
xcodebuild -create-xcframework -library /Users/<user>/Documents/<project>/libsodium-ios/ios64/lib/libsodium.a -headers /Users/<user>/Documents/<project>/libsodium-ios/ios64/include -library /Users/<user>/Documents/<project>/libsodium-ios/simulator64/lib/libsodium.a -headers /Users/<user>/Documents/<project>/libsodium-ios/simulator64/include -library /Users/<user>/Documents/<project>/libsodium-osx/lib/libsodium.a -headers /Users/<user>/Documents/<project>/libsodium-osx/include -output /Users/<user>/Documents/<project>/libsodium.xcframework
Warnings related to headers being present but not usable are due to functions that didn't exist in the specified minimum iOS version level.
They can be safely ignored.
xcframework successfully written out to: /Users/<user>/Documents/<project>/libsodium.xcframework
但添加 32 位版本后出现错误:
xcodebuild -create-xcframework -library /Users/<user>/Documents/<project>/libsodium-ios/ios32/lib/libsodium.a -headers /Users/<user>/Documents/<project>/libsodium-ios/ios32/include -library /Users/<user>/Documents/<project>/libsodium-ios/ios32s/lib/libsodium.a -headers /Users/<user>/Documents/<project>/libsodium-ios/ios32s/include -library /Users/<user>/Documents/<project>/libsodium-ios/ios64/lib/libsodium.a -headers /Users/<user>/Documents/<project>/libsodium-ios/ios64/include -library /Users/<user>/Documents/<project>/libsodium-ios/simulator32/lib/libsodium.a -headers /Users/<user>/Documents/<project>/libsodium-ios/simulator32/include -library /Users/<user>/Documents/<project>/libsodium-ios/simulator64/lib/libsodium.a -headers /Users/<user>/Documents/<project>/libsodium-ios/simulator64/include -library /Users/<user>/Documents/<project>/libsodium-osx/lib/libsodium.a -headers /Users/<user>/Documents/<project>/libsodium-osx/include -output /Users/<user>/Documents/<project>/libsodium-xcframework/libsodium.xcframework
Warnings related to headers being present but not usable are due to functions
that didn't exist in the specified minimum iOS version level.
They can be safely ignored.
The operation couldn’t be completed. (XCBCore.XCFrameworkValidationError error 8.)
什么是 XCBCore.XCFrameworkValidationError 错误 8?
如何为 Xcode 11 的 Mac (macOS + iOS) 的 UIKit 构建 libsodium?
更新: Build 不是 Mac 的 UIKit。问题已结束。都谢谢。