在 circleCI 上运行我的项目时,我不断收到链接器错误,提示未找到 Realm 框架。我的开发环境中的框架没有问题。我检查了框架搜索路径以包括 $(inherited) 和 carthage 构建文件夹 ($(PROJECT_DIR)/Carthage/Build/iOS)。以下是我的 cartfile 和 circle.yml(circleCI 的配置文件)的内容
购物车文件
github "Alamofire/Alamofire" ~> 3.4
github "Alamofire/AlamofireImage" ~> 2.0
github "SwiftyJSON/SwiftyJSON" ~> 2.3.0
github "SnapKit/SnapKit" >= 0.15.0
github "realm/realm-cocoa"
圆.yml
machine:
xcode:
version: "7.3"
dependencies:
pre:
- curl -O https://gist.githubusercontent.com/cabeca/cbaacbeb6a1cc4683aa5/raw/8e17f39f5a7413fd0559c9e6808e01b6fb514422/simulator_populator
- ruby ./simulator_populator
- carthage update --platform iOS
carthage update
之前的两行是 circleCI 支持技术人员建议的,以避免 tvOS 框架出现问题。我也尝试过将 carthage update
切换到 carthage bootstrap
,结果相同。以下是我收到的错误消息
从屏幕截图来看,似乎是在尝试链接测试文件时发生错误,但是测试和uitest文件都是xcode默认创建的,我还没有在上面添加任何东西
最佳答案
but both test and uitest files are default created by xcode, I haven't added anything on it yet
我认为这就是问题所在。您需要确保两个目标都可以通过build设置 FRAMEWORK_SEARCH_PATHS
找到框架。这应该包括相关框架的父目录,例如$(SRCROOT)/Carthage/Build/iOS
。您通常可以通过将框架拖动或添加到“Link Binary with Libraries”构建阶段来实现这一点。
关于ios - 使用 Realm 和 circleCI(使用 Carthage)构建失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38563246/