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

没有这样的模块

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

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

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


当前回答

我的解决办法是。在目标->构建设置->框架搜索路径和添加$(继承)。然而,如果它是一个cocoapods,你的答案可能在输出终端内。

其他回答

对我有效的是另一个问题的解决方案。关闭Xcode,重新打开项目作为工作空间。转到项目文件夹并打开.xcodeworkspace文件。 一旦你打开工作区(而不是项目),Pods应该作为顶级项目出现在project Navigator中。

在Xcode 10.1中,我的解决方案是在文件菜单中的工作区设置中改变构建系统。它默认设置为New Build System,将其更改为Legacy Build System,这就成功了。

至于xCode 12和模拟器,

当你导航到Pods时,错误可能会消失。项目导航器中的Xcodeproj, 在“排除架构”下的构建设置中,对于每个调试和发布,选择值为arm64的“任何iOS模拟器SDK”。

有时你必须安装pod。

打开终端 cd项目 圆荚体安装 打开.xcworkspace和 构建是成功的

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.