1

我在 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.)
  1. 什么是 XCBCore.XCFrameworkValidationError 错误 8?

  2. 如何为 Xcode 11 的 Mac (macOS + iOS) 的 UIKit 构建 libsodium?

更新: Build 不是 Mac 的 UIKit。问题已结束。都谢谢。

4

1 回答 1

1

UIKitForMac 仅在不支持 32 位的 macOS 10.15 上运行。

您的 XCFramework 应包含仅适用于 iOS 和 iOS 模拟器部件的 32 位二进制文​​件。

于 2019-06-11T13:38:39.677 回答