ios - 使用 Realm 和 circleCI(使用 Carthage)构建失败

标签 ios swift realm circleci carthage

在 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,结果相同。以下是我收到的错误消息 enter image description here

从屏幕截图来看,似乎是在尝试链接测试文件时发生错误,但是测试和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/

相关文章:

objective-c - Realm.io 关系查询

iOS 测试 : Is there a way to skip tests?

android - 将一个移动应用程序与其他应用程序(Android 和 IOS)集成

ios - CABasicAnimation 起源于右上角而不是中心

ios - Artefacts 在 Swift Xcode 中画线

ios - 我可以通过 Perfect 在 Linux 上使用 Realm 吗?

ios - 在 iOS 中捕获视频时将数据存储在视频帧中

swift - 在 iOS 应用程序中使用计时器和循环播放流畅的动画

swift - 带有泛型参数的闭包

swift - Realm 中的混合列表