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

没有这样的模块

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

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

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


当前回答

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

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

其他回答

我发现构建设置中的导入路径是错误的自定义(MySQL)模块。把它指向正确的方向后,信息就消失了。

我只是通过删除引用来删除框架,然后再次添加它们。

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.

我不太确定为什么Martin R在评论中对这个问题的回答被如此忽视:

确保您尝试简单地跳过导入框架,因为它已经与桥接头一起添加了。

希望这能有所帮助

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

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

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