ios Xcode 中的“未找到框架”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/32687105/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 07:45:00  来源:igfitidea点击:

'Framework not found' in Xcode

iosxcodexcode6ios-frameworks

提问by Kim Montano

I know this has been asked a couple of times. I followed instructions from these ones:

我知道这已经被问过几次了。我遵循了这些人的指示:

Adding frameworks to project in Xcode 5 and having *relative* paths added

将框架添加到 Xcode 5 中的项目并添加 *relative* 路径

xcode4: Linker error: Directory not found for option

xcode4:链接器错误:找不到选项的目录

Still Xcode is giving this error:

Xcode 仍然给出这个错误:

enter image description here

在此处输入图片说明

Here's my current configuration:

这是我目前的配置:

enter image description here

在此处输入图片说明

enter image description here

在此处输入图片说明

The bolts framework is so I can use the Parse SDK. I downloaded the blank project from here: https://parse.com/apps/quickstart#parse_data/mobile/ios/native/new

bolts 框架使我可以使用 Parse SDK。我从这里下载了空白项目:https: //parse.com/apps/quickstart#parse_data/mobile/ios/native/new

It's working. I tried to copy every config option, but it still doesn't work.

它正在工作。我试图复制每个配置选项,但它仍然不起作用。

回答by Abhinav

Try deleting Bolts.frameworkfrom linked framework and re-add it. Also, in your Framework Search Pathkeep path until Bolts.frameworklike $(PROJECT_DIR)/Boltsif it is inside Bolts folder at your project directory path.

尝试Bolts.framework从链接框架中删除并重新添加它。此外,在Framework Search Path保持路径,直到Bolts.framework$(PROJECT_DIR)/Bolts如果是螺栓文件夹内的项目目录路径。

回答by Lou Morda

I'm pretty new to iOS development. Apparently this problem for me was a result of opening the .xcodeproj Xcode project instead of the .xcworkspace Xcode workspace. I opened the workspace instead and the error has gone away.

我对 iOS 开发很陌生。显然,这个问题对我来说是打开 .xcodeproj Xcode 项目而不是 .xcworkspace Xcode 工作区的结果。我打开了工作区,错误消失了。

回答by frank

delete all frameworks from Embedded Binaries and re-add it

从嵌入式二进制文件中删除所有框架并重新添加

回答by KoreanXcodeWorker

Here is the solution :

这是解决方案:

Turn the "$(PROJECT_DIR)" attribute(might be non-recursive by default) into recursive option in Select Project Click on Targets Click - Build Settings Search for 'Framework Search Path' - Double click the input.

将“$(PROJECT_DIR)”属性(默认情况下可能是非递归的)转换为选择项目中的递归选项单击目标单击-构建设置搜索“框架搜索路径”-双击输入。

Scratched from https://stackoverflow.com/a/31298214/4493512

摘自https://stackoverflow.com/a/31298214/4493512

回答by AyAz

Delete the framework that is causing the issue (by removing the reference).

删除导致问题的框架(通过删除引用)。

Then add it again, following these steps for adding FBSDK frameworks and libraries:

然后再次添加,按照以下步骤添加 FBSDK 框架和库:

  1. click project
  2. general settings
  3. linked framework and libraries
  4. click the plus button and add all that you want
  1. 点击项目
  2. 通用设置
  3. 链接框架和库
  4. 单击加号按钮并添加您想要的所有内容

回答by Alexander Abakumov

I just had the same situation (was having a hard time to address the OP's build error after adding a 3rd party framework) and it seems like a bug in Xcode(mine is 8.3.2 (8E2002)).

我只是遇到了同样的情况(在添加 3rd 方框架后很难解决 OP 的构建错误),而且这似乎是Xcode(我的8.3.2 (8E2002))中的一个错误。

The problem was that a folder name in path to the framework contained spaces. In this case, Xcode incorrectly escaped them with backslashes like this in Build Settings->Framework Search Paths:

问题是框​​架路径中的文件夹名称包含空格。在这种情况下,Xcode 错误地使用如下反斜杠转义它们Build Settings->Framework Search Paths

$(PROJECT_DIR)/Folder\ with\ spaces/Lib

To fix this, just manually edit the entry to remove those backslashes and enclose the whole string in quotes like this:

要解决此问题,只需手动编辑条目以删除这些反斜杠并将整个字符串括在引号中,如下所示:

"$(PROJECT_DIR)/Folder with spaces/Lib"

回答by alicanozkara

me too was getting this error , I moved the framework file to the root project folder and added to framework again and problem is solved.

我也遇到了这个错误,我将框架文件移动到根项目文件夹并再次添加到框架,问题解决了。

回答by Andre Simon

Besides from removing the framework from the Podfileand Linked Frameworks and Libraries, I also had to remove the reference to the framework in Other Linker Flags.

除了从Podfileand 中删除框架之外Linked Frameworks and Libraries,我还必须在Other Linker Flags.

回答by Dave

None of the above worked for me until I found that I had a blank "Any Architecture | Any SDK" line underneath Framework Search Paths / Debug under Build Settings.

直到我发现我在构建设置下的框架搜索路径/调试下有一个空白的“任何架构|任何SDK”行之前,以上都不对我有用。

Deleted the line and it works!

删除该行,它的工作原理!

回答by Laura Corssac

When this error occurred to me was because Pods folder was in iCloud and had no local copy on my computer. Go to your project's folder in Finder and check if there is iCloud's symbol in any of the folders inside it!

当我发生此错误时,是因为 Pods 文件夹在 iCloud 中并且我的计算机上没有本地副本。在 Finder 中转到您项目的文件夹,然后检查其中的任何文件夹中是否有 iCloud 符号!