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

没有这样的模块

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

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

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


当前回答

在尝试了这个线程上的所有想法后,当我更新cocoapods时,它起作用了。

$ pod --version
$ 1.0.0 // should have been 1.10.0

你应该更新cocoapods

gem which cocoapods

其他回答

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

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

错误消失了。

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

我尝试了以上的解决方案,但不幸的是,没有一个对我有帮助。我后来做了什么

关闭项目。 从终端,进入工程目录并运行以下命令: Git重置-硬源/主(我想在主分支改变。) git获取 Git checkout master Git拉源主 打开项目(当然是从Xcode) 清除生成和删除派生数据。 再次构建项目。

是的,我知道有些命令是多余的。但花两天时间揪头发比那些步骤糟糕多了。

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.

实际上,通过添加到build-debug.xconfig的末尾,我更容易地解决了这个问题

#包括“. ./Pods/目标支持文件/Pods- iap /Pods- iap .debug.xcconfig"

一直到build-release.xconfig的末尾

#包括“. ./Pods/目标支持文件/Pods- iap /Pods- iap .release.xcconfig"

因为这些文件已经定义了PODS_ROOT和相关的构建变量。