获取“找不到文件”;将Objective-C框架导入Swift项目时,在Bridging Header中 [英] Getting "file not found" in Bridging Header when importing Objective-C frameworks into Swift project
问题描述
我有一个Swift项目,正在尝试导入基于ObjC的框架。该框架位于项目路径下的目录中,并由项目在Xcode中引用。
I have a Swift project for which I'm trying to import ObjC-based frameworks. The framework is located in a directory under the project's path and is referenced by the project in Xcode. It's also added to the "Link Binary with Libraries" in the project's 'Build Phases' page.
但是,由于某些原因,我似乎无法包含该框架。在 Bridging-Header文件中。我收到以下错误:
However, for some reason, I can't seem to include the framework in the Bridging-Header file. I get the following error:
BridgingHeader.h:5:9: error: 'Parse/Parse.h' file not found
#import <Parse/Parse.h>
^
<unknown>:0: error: failed to import bridging header 'BridgingHeader.h'
我检查过的东西:
- 安装Objective-C兼容性标头设置为是
- 标题搜索路径包括框架的路径。
我确定我缺少了一些东西,因此,如果有人有任何线索,那将是很棒的。
I'm sure I'm missing something, so if anyone has any clues, that would be great.
推荐答案
找到了解决方案:
- 必须在目标级别,而不是项目级别。确保删除项目级别的设置值。
(对我来说,这似乎是Xcode的错误,因为我不不知道为什么要修复它。)
(to me, it seems like an Xcode bug, since I don't know why it fixes it).
这篇关于获取“找不到文件”;将Objective-C框架导入Swift项目时,在Bridging Header中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!