1. <legend id='PUBWf'><style id='PUBWf'><dir id='PUBWf'><q id='PUBWf'></q></dir></style></legend>

        <small id='PUBWf'></small><noframes id='PUBWf'>

      2. <tfoot id='PUBWf'></tfoot>
          <bdo id='PUBWf'></bdo><ul id='PUBWf'></ul>
      3. <i id='PUBWf'><tr id='PUBWf'><dt id='PUBWf'><q id='PUBWf'><span id='PUBWf'><b id='PUBWf'><form id='PUBWf'><ins id='PUBWf'></ins><ul id='PUBWf'></ul><sub id='PUBWf'></sub></form><legend id='PUBWf'></legend><bdo id='PUBWf'><pre id='PUBWf'><center id='PUBWf'></center></pre></bdo></b><th id='PUBWf'></th></span></q></dt></tr></i><div id='PUBWf'><tfoot id='PUBWf'></tfoot><dl id='PUBWf'><fieldset id='PUBWf'></fieldset></dl></div>

        xcframework 不包含内部框架

        时间:2023-05-19
          1. <legend id='AeSNl'><style id='AeSNl'><dir id='AeSNl'><q id='AeSNl'></q></dir></style></legend>

            <tfoot id='AeSNl'></tfoot>

              <tbody id='AeSNl'></tbody>
              <i id='AeSNl'><tr id='AeSNl'><dt id='AeSNl'><q id='AeSNl'><span id='AeSNl'><b id='AeSNl'><form id='AeSNl'><ins id='AeSNl'></ins><ul id='AeSNl'></ul><sub id='AeSNl'></sub></form><legend id='AeSNl'></legend><bdo id='AeSNl'><pre id='AeSNl'><center id='AeSNl'></center></pre></bdo></b><th id='AeSNl'></th></span></q></dt></tr></i><div id='AeSNl'><tfoot id='AeSNl'></tfoot><dl id='AeSNl'><fieldset id='AeSNl'></fieldset></dl></div>
            • <small id='AeSNl'></small><noframes id='AeSNl'>

                <bdo id='AeSNl'></bdo><ul id='AeSNl'></ul>

                1. 本文介绍了xcframework 不包含内部框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我正在尝试为我正在使用的几个第三方库创建一个 .xcframework 文件.按照 https://appspector.com/blog/xcframeworks 的说明,我

                  I am trying to create an .xcframework file for a few third party libraries I'm using. Following the instructions from https://appspector.com/blog/xcframeworks, I

                  1. 创建特定于平台的 framework 文件:

                  # Archive for device
                  xcodebuild archive -scheme TestFramework -destination="iOS" -archivePath /tmp/xcf/ios.xcarchive -derivedDataPath /tmp/iphoneos -sdk iphoneos SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES
                  
                  # Archive for simulator
                  xcodebuild archive -scheme TestFramework -destination="iOS Simulator" -archivePath /tmp/xcf/iossimulator.xcarchive -derivedDataPath /tmp/iphoneos -sdk iphonesimulator SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES
                  

                  此时,我已经获得了两个带有 .swiftmodule 文件的框架;一切看起来都很好.框架确实带有 .swiftinterface 文件,但我认为没关系,因为这些是 objc 项目.那么,我

                  At this point, I've gotten two frameworks with .swiftmodule files; everything looks good. The frameworks do not come with .swiftinterface files, but I think that is alright as these are objc projects. Then, I

                  1. 将各个 framework 组合成一个单独的 xcframework 文件:
                  1. Combine the individual frameworks to form a single xcframework file:

                  # Build xcframework with two archives
                  xcodebuild -create-xcframework -framework /tmp/xcf/ios.xcarchive/Products/Library/Frameworks/TestFramework.framework -framework /tmp/xcf/iossimulator.xcarchive/Products/Library/Frameworks/TestFramework.framework -output /tmp/xcf/TestFramework.xcframework
                  

                  这里,xcodebuild 没有失败,但它会发出一个奇怪的错误:

                  Here, xcodebuild doesn't fail, but it emits a curious error:

                  No 'swiftinterface' files found within '/Users/user/git/ReactiveObjC/output/xcf/ios.xcarchive/Products/Products/Library/TestFramework.framework/Modules/TestFramework.swiftmodule'.
                  

                  至关重要的是,.xcframework 包不包含 Info.plistframework 文件夹代码>文件.显然,当我尝试在这种状态下链接到 xcframework 时,我会收到一堆缺少符号"链接器错误.

                  Crucially, the .xcframework package does not contain the individual frameworks or folders specified in the Info.plist file. Obviously, when I try to link to the xcframework in this state, I get a bunch of "missing symbols" linker errors.

                  这是为什么?我必须怎么做才能让 xcodebuild 完全创建 xcframework?

                  Why is this? What must I do to get xcodebuild to create the xcframework completely?

                  注意:目前手动创建文件夹似乎可行,但这感觉不对而且很脆弱——Apple 可以随时更改 xcodebuild 的工作方式.

                  NB: Manually creating the folders seems to work for now, but this feels wrong and is brittle – Apple can change the way xcodebuild works anytime.

                  推荐答案

                  原来在 xcodebuild 命令的末尾添加 BUILD_LIBRARY_FOR_DISTRIBUTION = YES 是不够的/不是努力使用所需的 swiftinterface 文件生成框架.我必须进入实际项目的设置并手动将 BUILD_LIBRARY_FOR_DISTRIBUTION 设置为 YES,例如 这个答案 建议.在我得到带有 swiftinterface 文件的框架后,我就能够使用 xcodebuild 创建 xcframework 文件而没有任何问题.

                  Turns out that adding BUILD_LIBRARY_FOR_DISTRIBUTION = YES to the end of the xcodebuild command was not enough / not working to produce a framework with the required swiftinterface files. I had to go in the settings for the actual project and manually set BUILD_LIBRARY_FOR_DISTRIBUTION to YES, like this answer suggests. After I got the frameworks with the swiftinterface files, I was then able to create the xcframework file using xcodebuild without any problems.

                  这篇关于xcframework 不包含内部框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:在 Swift 中使用 GLKit 中的 GLKMath 下一篇:如何在另一个框架内添加一个框架(Umbrella Framework)

                  相关文章

                2. <legend id='pWHb3'><style id='pWHb3'><dir id='pWHb3'><q id='pWHb3'></q></dir></style></legend>

                  1. <small id='pWHb3'></small><noframes id='pWHb3'>

                      <bdo id='pWHb3'></bdo><ul id='pWHb3'></ul>
                  2. <i id='pWHb3'><tr id='pWHb3'><dt id='pWHb3'><q id='pWHb3'><span id='pWHb3'><b id='pWHb3'><form id='pWHb3'><ins id='pWHb3'></ins><ul id='pWHb3'></ul><sub id='pWHb3'></sub></form><legend id='pWHb3'></legend><bdo id='pWHb3'><pre id='pWHb3'><center id='pWHb3'></center></pre></bdo></b><th id='pWHb3'></th></span></q></dt></tr></i><div id='pWHb3'><tfoot id='pWHb3'></tfoot><dl id='pWHb3'><fieldset id='pWHb3'></fieldset></dl></div>
                  3. <tfoot id='pWHb3'></tfoot>