我目前在Swift编码,我有一个错误:
没有这样的模块
但我不明白,因为这个模块在我的项目中,在“链接框架和库”和“嵌入式二进制文件”中声明。
框架是在Objective-C中,所以我为它写了一个桥标头。
请问,如何让Xcode识别框架?
我目前在Swift编码,我有一个错误:
没有这样的模块
但我不明白,因为这个模块在我的项目中,在“链接框架和库”和“嵌入式二进制文件”中声明。
框架是在Objective-C中,所以我为它写了一个桥标头。
请问,如何让Xcode识别框架?
当前回答
确保子项目中配置的命名与“父”项目相匹配。如果配置命名不完全匹配(区分大小写),Xcode将中止存档过程,并显示错误“No such module…”
也就是说,如果你有一个“父”项目,配置名为“AppStore”,你必须确保所有子项目也有这个配置名称。
请看我所附的截图。
其他回答
确保项目文件夹不在iCloud Drive中。
No such module编译错误
这是编译时错误。你可以在很多情况下得到它:
打开的是.xcodeproj而不是。xcworkspace 模块。modulemap or .swiftmodule[关于]
Objective-C库/框架目标
确保生成的二进制文件包含模块。modulemap文件和它的头文件位于Build Phases -> headers部分
框架搜索路径
Consumer ->框架
如果你试图在没有设置框架搜索路径(消费者)的情况下构建应用程序。在设置框架搜索路径指向框架资源后,Xcode将成功构建项目。然而,当你在模拟器中运行应用程序时,有一个崩溃的原因:Image not foundabout
它可以是一个绝对路径或相对路径,如$(SRCROOT)或$(SRCROOT)/..对于工作空间
导入路径
Swift消费者-> Swift静态库
导入路径(消费者)应该指向.swiftmodule
寻找隐式依赖关系
当您有一个隐式依赖项,但“查找隐式依赖项”已关闭时
CocoaPods
检查目标中是否存在此依赖项
pod deintegrate
pod install
CocoaPods UI测试包
对于应用程序目标,使用额外的依赖CocoaPods。要解决它使用继承![关于]在Podfile
(递归路径)
当“查找隐式依赖项”选项未选中时,可能会发生此错误。转到编辑方案->构建。
然后勾选这个选项。
有几个潜在的错误配置可能会导致这个问题,
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存档,但fastlane为我做了这项工作