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

    1. <legend id='krdji'><style id='krdji'><dir id='krdji'><q id='krdji'></q></dir></style></legend>
      <i id='krdji'><tr id='krdji'><dt id='krdji'><q id='krdji'><span id='krdji'><b id='krdji'><form id='krdji'><ins id='krdji'></ins><ul id='krdji'></ul><sub id='krdji'></sub></form><legend id='krdji'></legend><bdo id='krdji'><pre id='krdji'><center id='krdji'></center></pre></bdo></b><th id='krdji'></th></span></q></dt></tr></i><div id='krdji'><tfoot id='krdji'></tfoot><dl id='krdji'><fieldset id='krdji'></fieldset></dl></div>

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

      <tfoot id='krdji'></tfoot>

      具有 Pod 依赖项的 XCFramework

      时间:2023-05-19
        <bdo id='vaqqU'></bdo><ul id='vaqqU'></ul>
        <legend id='vaqqU'><style id='vaqqU'><dir id='vaqqU'><q id='vaqqU'></q></dir></style></legend>
      • <tfoot id='vaqqU'></tfoot>
      • <i id='vaqqU'><tr id='vaqqU'><dt id='vaqqU'><q id='vaqqU'><span id='vaqqU'><b id='vaqqU'><form id='vaqqU'><ins id='vaqqU'></ins><ul id='vaqqU'></ul><sub id='vaqqU'></sub></form><legend id='vaqqU'></legend><bdo id='vaqqU'><pre id='vaqqU'><center id='vaqqU'></center></pre></bdo></b><th id='vaqqU'></th></span></q></dt></tr></i><div id='vaqqU'><tfoot id='vaqqU'></tfoot><dl id='vaqqU'><fieldset id='vaqqU'></fieldset></dl></div>

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

                <tbody id='vaqqU'></tbody>
                本文介绍了具有 Pod 依赖项的 XCFramework的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                限时送ChatGPT账号..

                我们的目标是创建一个框架来隐藏我们的内部代码并向我们的客户提供 SDK.我们已经考虑创建满足我们要求的 XCFramework.互联网上也建议使用伞形框架,但大多建议避免这种方法.我们的框架依赖于我们通过 Pods 使用的一些第三方库.

                Our goal is to create a framework that hides our internal code and provide SDK to our customers. We have thought of creating XCFramework which fulfills our requirement. Umbrella framework is also suggested over the internet but mostly suggested to avoid that approach. Our Framework is dependent on some third-party libraries which we are using via Pods.

                问题:XCFramework 不编译 pods 框架.我们收到类似未找到 Xyz(Pod) 模块"的错误.即使我们从客户端添加 pod,它也不起作用.

                创建XCFramework的代码如下

                Code to create XCFramework is as bellow

                1) 为 iOS 平台创建存档

                xcodebuild archive -workspace ABC.xcworkspace 
                  -scheme ABC 
                  -sdk iphoneos 
                  -archivePath "./archives/ios_devices.xcarchive" 
                  BUILD_LIBRARY_FOR_DISTRIBUTION=YES 
                  SKIP_INSTALL=NO
                

                2) 为 iOS-Simulator 平台创建存档

                  xcodebuild archive  -workspace ABC.xcworkspace 
                  -scheme ABC 
                  -sdk iphonesimulator 
                  -archivePath "./archives/ios_simulators.xcarchive" 
                  BUILD_LIBRARY_FOR_DISTRIBUTION=YES 
                  SKIP_INSTALL=NO
                

                3) 从档案中创建 XCFramework

                xcodebuild -create-xcframework 
                -framework ./archives/ios_devices.xcarchive/Products/Library/Frameworks/ABC.framework 
                -framework ./archives/ios_simulators.xcarchive/Products/Library/Frameworks/ABC.framework 
                -output build/ABC.xcframework
                

                我们成功获得了 ABC XCFramework,但依赖项不包含在 XCFramework 中.有什么解决办法吗?或者有什么方法可以将框架搜索路径设置为客户端?或任何替代方法?

                We got ABC XCFramework successfully but dependencies are not included in XCFramework. Any solution for this? or Is there any way where we can set framework search path to client-side? or Any alternate approach?

                推荐答案

                你可以创建一个pod并发布它.

                You can create a pod and publish it.

                检查 https://guides.cocoapods.org/making/making-a-cocoapod.html

                带有 XCFramework + 第三方依赖的示例 Podspec 文件

                Sample Podspec file with XCFramework + Third party dependency

                Pod::Spec.new do |s|  
                    s.name              = 'XCFrameworkTest' # Name for your pod
                    s.version           = '0.0.1'
                    s.summary           = 'Sample Spec'
                    s.homepage          = 'https://www.google.com'
                
                    s.author            = { 'Sample' => 'sample@sample.com' }
                    s.license = { :type => "MIT", :text => "MIT License" }
                
                    s.platform          = :ios
                    # change the source location
                    s.source            = { :http => 'http://localhost:8080/XCFrameworkTest.zip' } 
                    s.ios.deployment_target = '10.0'
                    s.ios.vendored_frameworks = 'XCFrameworkTest.xcframework' # Your XCFramework
                    s.dependency 'PromisesSwift', '1.2.8' # Third Party Dependency
                end 
                

                发布 pod 后,客户可以使用 cocopods 获取我们的框架.

                After you publish your pod, Customer can use cocopods to get our framework.

                在客户的 Podfile 中

                In Customer's Podfile

                pod 'XCFrameworkTest' #Your pod name
                

                这篇关于具有 Pod 依赖项的 XCFramework的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:如何将 Crashlytics 集成到 iOS 框架目标中? 下一篇:Swift 应用程序:导入静态库的框架时“缺少必需的模块"

                相关文章

                    • <bdo id='u2vJm'></bdo><ul id='u2vJm'></ul>

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

                    <legend id='u2vJm'><style id='u2vJm'><dir id='u2vJm'><q id='u2vJm'></q></dir></style></legend>

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