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

没有这样的模块

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

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

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


当前回答

Sazzad Hissain Khan的3分。选项添加相同的“构建配置”在应用程序的框架,而不是在应用程序解决了我的“未知模块”问题。

这篇文章帮助我了解如何添加新的构建配置,因为进入编辑器->添加配置是灰色的

在Xcode中添加构建配置

其他回答

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

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

几分钟前我找到了解决我案子的办法。 该项目是一个使用cocos2d框架的objective c项目。 没有一个预览解决方案有效。

只是我删除VALID_ARCH行自定义在构建设置和项目开始构建模拟器。

请将此截图与您的构建设置进行比较。 这可能会奏效。 进入框架搜索路径:

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.

在podfile中,删除产生问题的pod,并保存该文件 运行pod安装 重新添加pod,保存文件 重新运行pod安装