我目前在Swift编码,我有一个错误:

没有这样的模块

但我不明白,因为这个模块在我的项目中,在“链接框架和库”和“嵌入式二进制文件”中声明。

框架是在Objective-C中,所以我为它写了一个桥标头。

请问,如何让Xcode识别框架?


当前回答

我用

链接的框架和库

将框架添加到Workspace文件夹的顶部。讨厌鬼。

其他回答

我在xcode 10.3中也遇到了类似的问题。xCode无法识别pod中的文件。这里我是这样解决的:

进入构建阶段 用库链接二进制文件 从pods中添加框架(在我的例子中是epsignature . framework) 清理和构建项目

错误消失了。

我发现构建设置中的导入路径是错误的自定义(MySQL)模块。把它指向正确的方向后,信息就消失了。

Another possible cause in XCode 10 can be the Supported Platforms sometimes gets changed to macOS and the Valid Architectures gets changed to i386 x86_64 for the Pods Projects. Assuming the project is for iOS, then select the Pods Project and change the Supported Platforms to iOS and the Valid Architectures to arm64 arm64e armv7 armv7s, You could do each of the Targets, however that takes longer if you have more than one Pod. Also the Swift version of frameworks in written Swift sometimes gets set to the wrong version.

对我来说,答案是去目标,首先检查目标名称和项目名称是否匹配,如果匹配,然后去通用->框架,手动添加它们。当我这样做时,我干净地构建了应用程序,一切都运行正常。不幸的是,之前的答案都没有解决我的问题,所以也许这也能帮助你。

对我来说,问题在于项目文件缺少这个文件“coursesX.xcworkspace”

当我添加它并重新打开项目时,一切都工作得很好