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

没有这样的模块

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

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

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


当前回答

确保Scheme中的“在构建中查找隐式依赖项”选项是打开的!

其他回答

有时你必须安装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.

对我来说,我修复了它替换任何波浪号(~)字符在我的自定义路径$(HOME)。自定义路径位于Xcode首选项的位置选项卡下。

在极少数情况下,此错误可以通过在[ProjectNavigator]->[项目]->[目标]->(架构)BaseSDK设置适当的平台来修复

当创建一个框架时,我不小心选择了错误的模板(因为我之前创建macOS框架),因为它被设置为喜欢我之前的选择。当添加目标时,很容易忽略配置平台,所以要仔细检查。

对我来说,解决同样问题的方法是相对于工作空间目录设置派生数据位置,而不是保持默认值。 去xcode的首选项。转到首选项中的位置选项卡,并将派生数据设置为相对。 希望能有所帮助。