伞架 [英] Umbrella framework

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

问题描述

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

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: 找不到架构 arm64 的框架embeddedInMyFramework"clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)

在嵌入式二进制文件和链接的框架和库中添加该框架(embeddedInMyFramework)并尝试构建比工作正常.稍后从嵌入式二进制文件和链接的框架和库中删除该框架,并且仍然可以正常工作.有人可以帮我解决这个问题,不确定当我第一次将框架添加到嵌入式二进制文件时会发生什么,以及如何解决这个问题(它是否可以在不添加到嵌入式二进制文件的情况下以某种方式工作)

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)

推荐答案

我能够建立一个有效的 Umbrella 框架并写下我的方法.

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

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

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


  • 一个基于 Swift 的客户端"项目,将 Umbrella 框架作为依赖项

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

依赖于 Umbrella 框架的动态框架(主要是 C++ 和 ObjC)

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


  1. 将 Umbrella 框架与其相关(子)框架链接,并确保在构建时将其复制到产品中.

构建阶段">


2.将依赖(子)框架的位置添加到Umbrella Framework项目的Framework Search Paths中.


3. 在客户端"项目中确保链接并嵌入 Umbrella 框架


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


4. 确保将 Umbrella 框架复制到(客户端)应用程序包中以避免 dyld: Library not loaded: @rpath/... 错误.通常在 ...Build/Products/Debug-iphoneos/YOUR_CLIENT_APP.app 下的(客户端)应用程序现在应该在名为 Frameworks 的文件夹中包含您的 Umbrella 框架.


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.


5.在client"项目中确保将Umbrella Framework的路径添加到Framework Search Paths.
如果 ld: framework not found '[Framework_Name]' for架构...错误仍然存​​在您也可以在此处添加(子)框架的路径.


5. 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天全站免登陆