我目前在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 10+和项目,还有一个建议。创建Xcode版本< 10,2。包含带有主项目所依赖的框架的子项目。问题是Xcode会将编译后的框架放在子项目中指定的目录中,这可能与主项目的构建目录不同。

检查文件>项目设置。现在,单击“Advanced…”并选择“Legacy”以外的内容作为构建路径,例如,“Unique”。在这种情况下,Xcode将把所有构建的组件放到一个文件夹中,它应该能够找到“丢失”的模块。

我用

链接的框架和库

将框架添加到Workspace文件夹的顶部。讨厌鬼。

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

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

错误消失了。

我在开发定制Pod时遇到了这个问题。发现我只需要在我的Procfile中指定依赖项:

Pod::Spec.new do |s|
   # ... other declarations

   s.dependency 'Alamofire', '~> 4.3'
end

我在开发自己的第一款应用时也遇到了同样的问题

使用.xcodeproj打开项目

Xcode辞职

从.xcworkspace重新打开项目