在Jenkins上使用xcodebuild尝试使用Cocoapods构建应用程序的链接错误

Rob*_*her 14 xcode jenkins cocoapods

我正在尝试为我们的应用开发项目设置Jenkins CI实例.我有工作,使用Debug配置运行逻辑和应用程序测试,但我正在努力构建IPA,因为我在编译期间遇到链接错误.

ld: library not found for -lPods
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Run Code Online (Sandbox Code Playgroud)

该应用程序使用Cocoapods,我正在使用Jenkins XCode插件构建.

我搜索了类似的问题,并尝试/验证了一堆东西:

  • 我正在使用工作区.
  • pod install在xcodebuild步骤之前运行.
  • 我已经检查了项目本身的架构,目标和Pod是相同的 - 标准(armv7,armv7s) - 正如这个答案所建议的那样
  • 我尝试了这个GitHub线程的各种解决方案
  • 我根据此答案和类似的答案尝试了各种设置的派生数据位置
  • Podfile指定 platform :ios, :deployment_target => "6.0"

在那一点上,我不知道还有什么可以尝试的.

apo*_*che -2

如果您使用 XCode 5 那么我认为应该有帮助

基本上更新您的 Gemfile(如果不存在则创建一个)并添加:

gem 'cocoapods', :git => 'http://github.com/CocoaPods/CocoaPods', :branch => 'xcode-5-support'
gem 'xcodeproj', :git => 'http://github.com/CocoaPods/Xcodeproj', :branch => 'redacted-support'
Run Code Online (Sandbox Code Playgroud)

另外,如果您config.build_settings['ARCHS'] = 'armv7'的 Podfile 中有类似的内容,请不要忘记删除它,您还需要有 armv7s。

希望这会有所帮助,因为它让我免去了几天的噩梦。