我目前在Swift编码,我有一个错误:
没有这样的模块
但我不明白,因为这个模块在我的项目中,在“链接框架和库”和“嵌入式二进制文件”中声明。
框架是在Objective-C中,所以我为它写了一个桥标头。
请问,如何让Xcode识别框架?
我目前在Swift编码,我有一个错误:
没有这样的模块
但我不明白,因为这个模块在我的项目中,在“链接框架和库”和“嵌入式二进制文件”中声明。
框架是在Objective-C中,所以我为它写了一个桥标头。
请问,如何让Xcode识别框架?
当前回答
有几个潜在的错误配置可能会导致这个问题,
Please confirm that you have opened the .xcworkspace but not .xcodeproj file. Also make sure you have build Social first before you build TriviaApp. Make sure that iOS Deployment Target is set same for all modules with main app. For example is TriviaApps deployment target is set to 9.0, Socials deployment target also need to be set to 9.0. Make sure your main module (TriviaApp) and your used framework (Social) have same set of configurations. i.e. If your Project has three configurations, Debug, Release, ReleasePremium than your Social framework also need to have three configurations Debug, Release, ReleasePremium. Also make sure that the archive configuration is set same for both TriviaApp and Social. i.e. if your TriviaApps archive scheme is set to ReleasePremium, your Socials archive scheme also need to be set into ReleasePremium. Please assure that you do not need to import Social in each .swift files when its already added in the Bridging-Header.h. In case of issue came from Pod files, make sure you have uncommented #use_frameworks! into use_frameworks! from you Podfile. Sometime re installing pod works if Social has any dependency on pods. If none of the above steps works, delete your derived data folder and try re building.
其他回答
在我的例子中,我只需要重新加载项目。我使用命令行克隆我的项目,但它没有正确安装子模块。为了补救,我通过XCode克隆了项目,一切正常。只是要确保先备份所有更改。
当“查找隐式依赖项”选项未选中时,可能会发生此错误。转到编辑方案->构建。
然后勾选这个选项。
在我的情况下,我尝试了上面的每一个建议仍然没有工作。 我只是复制文件的内容,显示错误没有导入的东西,并将其粘贴到另一个文件相同的导入和注释错误文件。 再次运行项目,它工作,然后我删除原来的错误文件,并创建一个同名的文件,并使其内容再次使用相同的导入。 我认为在我的情况下,我只是想办法让它能够链接那些导入一次,它应该是好的。
如果这只是一个简单的项目,没有可可足类,就像我做的, 你可以尝试移动你的框架到你的项目目录和重新链接。 我把它放在桌面上,但是链接和“导入我的框架”犯了一个错误。在将其移动到项目目录并再次链接后,它工作了。
如果你使用迦太基,建筑设置中的框架通常是不变的
$ (PROJECT_DIR) /迦太基/构建/ iOS
如果你运行carthage update—platform ios—no- Build(为了节省时间),Build文件夹中的文件将不会被重新创建,那么这些模块将无法用于XCode。
以我为例,我运行了carthage update平台ios,然后我的问题就解决了。