伞形框架 [英] Umbrella framework

查看:161
本文介绍了伞形框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个插入第二个框架的框架,即所谓的伞形框架。当我在测试应用程序中插入框架(嵌入式二进制文件和链接框架和库,都是)无法构建应用程序时,出现以下错误:

ld:框架未找到'embeddedInMyFramework'用于架构arm64
clang:错误:linker命令失败,退出代码1(使用-v查看调用)



在嵌入式二进制文件和链接框架和库中添加该框架(embeddedInMyFramework),并尝试构建而不是正常工作。稍后从嵌入式二进制文件和链接框架和库中移除该框架,并仍然正常工作。有人可以帮我解决这个问题,不确定当我第一次为嵌入式二进制文件添加框架时会发生什么,以及如何解决这个问题(它可以以某种方式工作,而无需添加任何嵌入式二进制文件)

解决方案

我能够建立一个有效的Umbrella Framework并写下我的方法。



第5步应删除您的链接器错误 ld:framework not found ..






设定:




  • 一个基于Swift的客户项目,具有Umbrella Framework作为依赖关系


  • 一个动态框架(主要是C ++和ObjC),它依赖于Umbrella Framework




    1. 将Umbrella Framework与其依赖的(子)框架链接起来,并确保在构建时将其复制到产品中。
    2. >





    2.将依赖(子)框架的位置添加到 Framework搜索Umbrella Framework项目的路径







    3.在客户项目中,确保链接并嵌入伞形框架
    p>





    4.确保Umbrella Framework被复制到(客户端)应用程序包中以避免 dyld:Library未加载:@rpath /... errors。
    通常在 ... Build / Products / Debug-iphoneos / YOUR_CLIENT_APP.app 下的(client-)应用程序现在应该包含您的Umbrella Framework在名为 Frameworks





    $ b 1.在client项目中确保将Umbrella Framework的路径添加到 Framework搜索路径。<
    如果
    架构没有找到 ld:framework找不到'[Framework_Name]'... 错误仍然存​​在,您还可以将路径添加到(sub- )框架。




    I've created a framework in which is inserted the second framework, the so-called "umbrella framework". When I insert the framework in the test application(embedded binaries and linked frameworks and libraries, both) can not build app, I get the following error:

    ld: framework not found 'embeddedInMyFramework' for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

    Than add that framework(embeddedInMyFramework) also in embedded binaries and linked frameworks and libraries and try to build than works ok. Later remove that framework from both, embedded binaries and linked frameworks and libraries and still works fine. Can someone help me with this, not sure what happens when I add framework to embedded binaries for the first time, and how to fix that (could it work somehow without adding to embedded binaries at all)

    解决方案

    I was able to set up a working Umbrella Framework and wrote down my approach.

    Step 5 should remove your linker error ld: framework not found ..


    Setup:

    • A Swift based "client" project that has the Umbrella Framework as dependency

    • A dynamic Framework (mainly C++ and ObjC) that is a dependency of the Umbrella Framework


    Steps:

    1. Link the Umbrella Framework with its dependent (sub-)Framework and make sure that it is copied into the product upon building.


    2. Add the location of the dependent (sub-)framework to the Framework Search Paths of the Umbrella Framework project.


    3. In the "client" project make sure to link and embed the Umbrella Framework


    4. Make sure the Umbrella Framework is copied into the (client-) app bundle to avoid dyld: Library not loaded: @rpath/... errors. The (client-) app, usually under ...Build/Products/Debug-iphoneos/YOUR_CLIENT_APP.app should now contain your Umbrella Framework in a folder called Frameworks.


    1. In the "client" project Make sure to add the path to the Umbrella Framework to Framework Search Paths.
    If the ld: framework not found '[Framework_Name]' for architecture ... error persists you can also add the path to the (sub-) Framework here.

    这篇关于伞形框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆