ios - Xcode 8 中的 "No such module"错误

标签 ios swift xcode8 carthage

我在 Swift 项目的 Xcode 8.2.1 中遇到“No such module”编译错误。我将 Carthage 与两个模块一起使用:Alamofire 和 Fuzi。 Carthage/Build/iOS 目录与两个框架文件一起存在。 Build Settings/Framework Search Paths 指向该目录。我已将这两个框架文件嵌入到 General/Embedded Binaries 中。我错过了什么?

最佳答案

您不需要嵌入库;它们应该添加到“常规/嵌入式二进制文件”部分下的链接框架和库。确保将 Carthage copy-frameworks 脚本添加到构建阶段。

来自迦太基文档:

On your application targets’ “General” settings tab, in the “Linked Frameworks and Libraries” section, drag and drop each framework you want to use from the Carthage/Build folder on disk. On your application targets’ “Build Phases” settings tab, click the “+” icon and choose “New Run Script Phase”. Create a Run Script in which you specify your shell (ex: bin/sh), add the following contents to the script area below the shell:

/usr/local/bin/carthage copy-frameworks

and add the paths to the frameworks you want to use under “Input Files”, e.g.:

$(SRCROOT)/Carthage/Build/iOS/Box.framework
$(SRCROOT)/Carthage/Build/iOS/Result.framework
$(SRCROOT)/Carthage/Build/iOS/ReactiveCocoa.framework

This script works around an App Store submission bug triggered by universal binaries and ensures that necessary bitcode-related files and dSYMs are copied when archiving.

关于ios - Xcode 8 中的 "No such module"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41409467/

相关文章:

ios - 带有通过 CocoaPods 导入的 Obj-C 类的 Swift 项目?

ios - 用于 iOS 的 Lua 脚本

ios - 如何在 Swift 中检查 SDK 中是否存在互斥方法?

ios - AudioKit 5 iOS 当前播放时间

ios - xcode 8 调试器 'Could not resolve type'

ios - RMStore openssl/pkcs7.h 文件未找到

iphone - UILabel sizeToFit - 调整下方对象的位置

ios - didAnimateRoation toInterfaceorientation - 检测旋转何时完成?

objective-c - 如何向以编程方式创建的按钮添加方法?

swift3 - 使用用户定义的运行时属性的UIView Shadow