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

没有这样的模块

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

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

请问,如何让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.

其他回答

我仍然不能从xcode存档,但fastlane为我做了这项工作

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

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

你应该更新cocoapods

gem which cocoapods

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

我刚刚删除了我的cocoapod。然后,我做了一个豆荚安装来移除它。然后,我只是把它添加回我的podfile,并重新安装它。这让它成功了。不知道为什么。

假设框架真的在那里,在道路上,等等……删除~/Library/Developer/Xcode/DerivedData/ModuleCache目录(清理项目并删除项目特定的派生数据)。

在执行标准清理时,不会重新构建ModuleCache目录。