我目前在Swift编码,我有一个错误:
没有这样的模块
但我不明白,因为这个模块在我的项目中,在“链接框架和库”和“嵌入式二进制文件”中声明。
框架是在Objective-C中,所以我为它写了一个桥标头。
请问,如何让Xcode识别框架?
我目前在Swift编码,我有一个错误:
没有这样的模块
但我不明白,因为这个模块在我的项目中,在“链接框架和库”和“嵌入式二进制文件”中声明。
框架是在Objective-C中,所以我为它写了一个桥标头。
请问,如何让Xcode识别框架?
当前回答
下面的步骤对我很有效。
xcode辞职 在终端运行“pod update” 打开.xcworkspace并再次构建。
其他回答
请将此截图与您的构建设置进行比较。 这可能会奏效。 进入框架搜索路径:
几天前我也遇到了同样的错误。下面是我解决这个问题的方法:
错误是“模块未找到”
Create Podfile in your root project directory Install cocoapods (a dependency manager for Swift and iOS projects) Run pod install Go to Project Build Settings: Find Objective-c bridging Header under Swift compiler - Code Generation (If you don't find Swift compiler here, probably add a new Swift file to the project) Drag and drop the library header file from left side to bridging header (see image attached) Create a new bridging header file: e.g TestProject-Bridging-Header.h and put under Swift Compiler → Objective-C Generated Interface Header Name (ref, see the image above) In TestProject-Bridging-Header.h file, write #import "Mixpanel/Mixpanel.h" In your Swift file the code should be: Import Mixpanel (i.e name of library)
这是所有。
几分钟前我找到了解决我案子的办法。 该项目是一个使用cocos2d框架的objective c项目。 没有一个预览解决方案有效。
只是我删除VALID_ARCH行自定义在构建设置和项目开始构建模拟器。
如果你做了以上所有的事情,仍然没有工作,然后尝试在你的目标构建设置的框架搜索路径中添加$(inherited)。
如果这只是一个简单的项目,没有可可足类,就像我做的, 你可以尝试移动你的框架到你的项目目录和重新链接。 我把它放在桌面上,但是链接和“导入我的框架”犯了一个错误。在将其移动到项目目录并再次链接后,它工作了。