Saz*_*han 3 xcode xcodebuild ios xcframework xcode12
我已切换到Xcode12我的静态库应用程序之一。我正在尝试制作 XCFramework 发行版。运行构建命令后,
xcodebuild archive -scheme "MySDK" -sdk iphoneos -archivePath \xe2\x80\x9c./archives/ios.xcarchive\xe2\x80\x9d -SKIP_INSTALL=NO\nRun Code Online (Sandbox Code Playgroud)\nBuild Settings -> Build Libraries for Distribution当我切换到时出现以下错误YES,
<unknown>:0: error: using bridging headers with module interfaces is unsupported\nCommand CompileSwiftSources failed with a nonzero exit code\n\n** ARCHIVE FAILED **\n\n\nThe following build commands failed:\n CompileSwiftSources normal armv7 com.apple.xcode.tools.swift.compiler\n CompileSwiftSources normal armv7s com.apple.xcode.tools.swift.compiler\n CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler\n(3 failures)\nRun Code Online (Sandbox Code Playgroud)\n这个答案有效,但不幸的是创建.xcframework需要设置选项 distribution YES。
如何解决这个问题?
\nApple 似乎不赞成使用桥接标头,转而使用模块,但他们缺少有关如何包含 C 标头的文档。这些信息可以在更详细的clang 文档中找到。
尝试从项目设置中删除桥接头并创建一个module.modulemap文件:
module MySdk {
header "MySdk-Bridging-Header.h"
export *
}
Run Code Online (Sandbox Code Playgroud)
这有一些警告,例如需要import MySdk在你的 swift 代码中并理解 C 函数将被公开,但它让我克服了困难。
我通过反复试验发现的一个技巧是将此模块映射文件和 C 头文件包含在框架的文件Headers夹中。这允许使用该框架的任何应用程序自动检测MySdk为模块。
| 归档时间: |
|
| 查看次数: |
3706 次 |
| 最近记录: |