ios - 无法将 Pod 链接到 Calabash 目标

标签 ios xcode cocoapods calabash

我们在 Calabash 目标中集成 CocoaPods 时遇到一些问题。

目前我们有 4 个目标:

应用:普通应用目标
AppTests:单元测试目标
App-Calabash:葫芦目标
App-API-Stubs:特殊目标

我们希望在 App、App-Calabash 和 App-API-Stubs 之间共享所有 Pod。 此外,AppTests 和 App-Calabash 必须包含其他库。

这是我们的 Podfile:

source 'https://github.com/CocoaPods/Specs.git'

platform :ios, '7.0'

link_with 'App', 'App-Calabash', 'App-API-Stubs'
inhibit_all_warnings!

pod 'MagicalRecord', '~> 2.2'
pod 'AFNetworking', '~> 2.3.1'
pod 'ObjectiveSugar', '~> 1.1.0'
pod 'KZPropertyMapper', '~> 2.5.0'
pod 'FXBlurView', '~> 1.6.2'
pod 'OHHTTPStubs', '~> 3.1.5'
pod 'Google-Maps-iOS-SDK', '~> 1.8.1'
pod 'KVOController', '~> 1.0.1'
pod 'Braintree', '~> 3.3.1'
pod 'TTTAttributedLabel', '~> 1.10.1'
pod 'ObjectiveLuhn', '~> 1.0.0'
pod 'CrashlyticsFramework', '~> 2.2.1'

target 'App-Calabash', :exclusive => true do
  pod 'Calabash', '~> 0.9.169'
end

target 'AppTests', :exclusive => true do
  pod 'Specta', '~> 0.2.1'
  pod 'Expecta', '~> 0.3.0'
  pod 'OCMock', '~> 3.1.1'
end

所有目标都构建并运行得很好,但 Calabash 目标除外。
它提示找不到 Crashlytics/Crashlytics.h。但即使我们暂时避免使用 Crashlytics,它也会在链接过程中提示 Calabash 库:

ld: warning: directory not found for option '-L/Users/Marco/ios/App/Pods/build/Debug-iphoneos'
ld: file not found: -lPods-App-Calabash-Calabash
clang: error: linker command failed with exit code 1 (use -v to see invocation)

因此,将 Pod 集成到该特定目标时似乎出现了严重错误。
我很确定我错过了一些简单的东西,但我无法弄清楚。

非常感谢任何帮助。谢谢!

最佳答案

我花了一上午的时间寻找解决方案。我在这里找到了答案http://flexpletives.blogspot.com.es/2014/02/ios7-tdd-w-ocmock-and-xcode5.html

转到您的 Calabash 目标 -> build设置 -> 其他链接器标志

删除“-force_load” 添加“-all_load”

关于ios - 无法将 Pod 链接到 Calabash 目标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26232612/

相关文章:

objective-c - 在 swift 中创建依赖于另一个 objective-c pod 的 pod

swift - 在 swift 项目中使用已安装的 pod

ios - 旋转2个盒子相交

ios - UITableView 上的手势冲突滑动以删除 iOS

ios - AudioQueueDispose延迟

iOS RestKit 问题 : Invalid parameter not satisfying: responseDescriptors

ios - UIImage 类型的值没有成员 dominantColors

ios - 为什么 Swift 中的 stride 函数会这样工作?

ios - 我如何调用一个号码,然后在五秒钟后在拨号盘上键入数字?

ios - 快速从 FB 获取用户信息