xcode ld:未找到框架 - 框架错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/36904636/
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-09-15 08:46:15  来源:igfitidea点击:

ld: framework not found -framework ERROR

iosxcodeentity-frameworklinkerclang

提问by Gugulethu

I am consistently getting this error each time I try to build my project:

每次我尝试构建我的项目时,我总是遇到这个错误:

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

I don't even know what framework is called -framework

我什至不知道叫什么框架 -framework

This random started two days back just after a commit on a view controller that was not related to any changed in the pods.

这个随机在两天前开始提交后,视图控制器与 pod 中的任何更改无关。

I have tried all the solutions. I did google and spent time approx. 12 hours and found this links : link1, link2, link3.

我已经尝试了所有的解决方案。我做了谷歌并花了大约时间。12 小时,发现这个链接:link1link2link3

Also found lots other links but none are to the point which i am looking for.

还发现了很多其他链接,但没有一个是我正在寻找的。

I attempted below techniques to solve the problem:

我尝试了以下技术来解决问题:

  1. Deleting Derived Data - Rebooting Xcode - Cleaning & Building the Project.
  2. Deleting/ Adjusting the Framework Search Paths
  3. Adding -frameworkto Other Linker Flags in the Build Settings of the target project.
  1. 删除派生数据 - 重新启动 Xcode - 清理和构建项目。
  2. 删除/调整框架搜索路径
  3. -framework在目标项目的构建设置中添加到其他链接器标志。

Could anyone PLEASE help me if there are any further ideas on getting rid this -frameworkerror. I am due for launch in a month and can't re-start building the project from scratch!!!

如果有关于摆脱此-framework错误的任何进一步想法,请任何人都可以帮助我。我将在一个月后发布,无法从头开始重新构建项目!!!

By the way I am using cocoa pods to handle all the private frameworks which has workout out fine all along.

顺便说一下,我正在使用可可豆荚来处理所有一直运行良好的私有框架。

Thanks in advance.

提前致谢。

Here is a screen shot of the error. enter image description here

这是错误的屏幕截图。 在此处输入图片说明

Here are the screen shots of the framework search paths. enter image description hereenter image description here

以下是框架搜索路径的屏幕截图。 在此处输入图片说明在此处输入图片说明

回答by Shubhank

Your Other Linker flagsseemed to have the -frameworkadded which was failing to compile.

Other Linker flags似乎-framework添加了无法编译的内容。

Always make sure to check framework/library and linker path flags if the project shows framework/library not found error.

如果项目显示未找到框架/库错误,请务必检查框架/库和链接器路径标志。

回答by basvk

I had a simular error in one of our projects. It turned out that the framework itself got corrupted / damaged. Probably because of symlinks in combination with git.
For some reasone the actual binary in the .frameworkfile was missing.
Which would make XCode throw that specific compile error.

我在我们的一个项目中遇到了一个类似的错误。事实证明,框架本身已损坏/损坏。可能是因为符号链接与 git 结合使用。
出于某种原因,文件中的实际二进制.framework文件丢失了。
这将使 XCode 抛出特定的编译错误。

Solution was to replace the framework with the 'original' one and even move the framework to another (sub)directory in the project, so git was able to "pick it up" again.

解决方案是用“原始”框架替换框架,甚至将框架移动到项目中的另一个(子)目录,因此 git 能够再次“捡起它”。

回答by Nikolay Suvandzhiev

I got the same error message and then I realised that the .frameworkwas build for iphoneos(real device) but then I was trying to include it and run it on iphonesimulator(Simulator).

我收到了相同的错误消息,然后我意识到它.framework是为iphoneos(真实设备)构建的,但后来我试图包含它并在iphonesimulator(模拟器)上运行它。