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

没有这样的模块

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

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

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


当前回答

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

使用.xcodeproj打开项目

Xcode辞职

从.xcworkspace重新打开项目

其他回答

如果你做了以上所有的事情,仍然没有工作,然后尝试在你的目标构建设置的框架搜索路径中添加$(inherited)。

我的问题(这一次)是我在Podfile中使用了一个过时的库版本。

我使用:

pod 'LBTAComponents', '~> 0.1.9'

这并没有起作用,但当我把它改成:

pod 'LBTAComponents', '~> 1.0.2'

它工作。

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.

请将此截图与您的构建设置进行比较。 这可能会奏效。 进入框架搜索路径:

我在加载FacebookSDK时遇到了类似的问题,我添加了~/Documents/FacebookSDK(搜索你的框架在哪里)到构建设置中的框架搜索路径,之后我就可以导入FBSDKShareKit模块了