ios - 将 FaSTLane 与 CircleCI 集成 : Cocoapods framework not found

标签 ios swift cocoapods circleci fastlane

我正在尝试为我的 iOS 应用程序设置 CircleCI,并且我想与 FaSTLane 集成。 我的 circle.yml 看起来像这样:

machine:
 xcode:
    version: 8.3.1

dependencies:
  pre:
    - gem install bundler

  post:
    - bundle install
    - bundle exec pod install
    - bundle exec fastlane test

在完成编译测试文件之前,构建一切正常;显示这个错误

[04:39:38]: ▸ Compiling LoginViewControllerSpec.swift
[04:39:38]: ▸ Compiling QuestionSpec.swift
[04:39:38]: ▸ Compiling ItemSpec.swift
[04:39:38]: ▸ Linking myApp-iosTests
[04:39:38]: ▸ ❌  ld: framework not found Pods_Tests_myAppTests
[04:39:38]: ▸ ❌  clang: error: linker command failed with exit code 1 (use -v to see invocation)

这是 Podfile(我使用 cocoapods v1.2.1)

target 'myApp' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

    pod "PulsingHalo"
    pod 'OpenTok'
    pod 'Alamofire', '4.0'
    pod 'PieCharts'
    pod 'SwiftHEXColors'
    pod 'IQKeyboardManagerSwift'
    pod 'OAuthSwiftAlamofire'
    pod 'AlamofireObjectMapper', '~> 4.0'


  target 'myAppTests' do
    inherit! :search_paths
    # Pods for testing
    pod 'Quick'
        pod 'Nimble'
  end

  target 'myAppUITests' do
    inherit! :search_paths
    # Pods for testing
    pod 'Quick'
    pod 'Nimble'
  end

end

我试了两天没有成功。我还更改了测试目标中的构建选项 enter image description here

非常感谢您能为我提供的任何帮助。

谢谢

最佳答案

您能否确保 podfile 中的目标名称与构建阶段中的二进制框架名称相匹配。

还有一个旁注; bundle exec pod install 没什么问题,但我会将 pod install 移至 faSTLane,有一个名为 before_all 的 channel 可以为您安装 pod在您的测试车道之前。

platform :ios do |options|
  before_all do |lane, options|
   cocoapods // this would replace pod install
  end

关于ios - 将 FaSTLane 与 CircleCI 集成 : Cocoapods framework not found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44137063/

相关文章:

ios - titleForHeaderInSection 的文本太长

使用 FirebaseApp.configure() 时 iOS 应用崩溃

ios - 向左/向右滑动或将表格 View 拉出屏幕时,单元格动画停止

ios - 与 Facebook Messenger 分享文本

ios - 平移手势无法正常工作

ios - 将 UITableViewController 子类重构为 UIViewController 子类

ios - iOS 10 上的 UIVisualEffectView 掩码

ios - cocoa 足类 1.0 : same pods for multiple targets

cocoapods - 在同一项目中使用 Carthage 和 CocoaPods

ios - 如何在另一个脚本中调用 `pod` 或 'target'