我目前在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.
其他回答
对我来说,我修复了它替换任何波浪号(~)字符在我的自定义路径$(HOME)。自定义路径位于Xcode首选项的位置选项卡下。
对我来说,答案是去目标,首先检查目标名称和项目名称是否匹配,如果匹配,然后去通用->框架,手动添加它们。当我这样做时,我干净地构建了应用程序,一切都运行正常。不幸的是,之前的答案都没有解决我的问题,所以也许这也能帮助你。
对我来说,编辑方案->运行,并将调试配置从发布更改为调试解决问题。
Sazzad Hissain Khan的3分。选项添加相同的“构建配置”在应用程序的框架,而不是在应用程序解决了我的“未知模块”问题。
这篇文章帮助我了解如何添加新的构建配置,因为进入编辑器->添加配置是灰色的
在Xcode中添加构建配置
在目标的构建设置中,将“框架搜索路径”设置为$(inherited)和递归。 [