【问题标题】:Getting `ld: directory not found for option` build error after installing cocoa pod安装可可豆荚后出现“ld:找不到选项的目录”构建错误
【发布时间】:2021-11-05 15:39:50
【问题描述】:

我为我的 Xcode 项目安装了一个新的 cocoa pod (LaunchDarkly),但在尝试构建项目时,我的 CI 服务器中出现以下错误:

⚠️  ld: directory not found for option '-F/Users/runner/Library/Developer/Xcode/DerivedData/ProjectName-hlaqakonueydmsgzoxgekwjpjyds/Build/Products/Debug-iphonesimulator/LDSwiftEventSource'

⚠️  ld: directory not found for option '-F/Users/runner/Library/Developer/Xcode/DerivedData/ProjectName-hlaqakonueydmsgzoxgekwjpjyds/Build/Products/Debug-iphonesimulator/LaunchDarkly'

❌  ld: framework not found LDSwiftEventSource
❌  clang: error: linker command failed with exit code 1 (use -v to see invocation)

我该如何解决这个问题?

【问题讨论】:

    标签: xcode build continuous-integration cocoapods xcodebuild


    【解决方案1】:

    我意识到问题在于我仍在构建.xcodeproj 文件,如下所示:

    xcodebuild build-for-testing
            -project ProjectName.xcodeproj
            -scheme ProjectName
            -destination 'platform=iOS Simulator,name=iPhone 12,OS=latest'
            -testPlan UnitTests
            | xcpretty
    

    但由于我现在在我的项目中使用可可豆荚,我需要使用 .xcworkspace file 来构建它:

    xcodebuild build-for-testing
            -workspace ProjectName.xcworkspace
            -scheme ProjectName
            -destination 'platform=iOS Simulator,name=iPhone 12,OS=latest'
            -testPlan UnitTests
            | xcpretty
    

    【讨论】:

      猜你喜欢
      • 2019-11-27
      • 2015-10-02
      • 2015-09-24
      • 1970-01-01
      • 2016-08-16
      • 1970-01-01
      • 2018-04-01
      • 2019-05-20
      相关资源
      最近更新 更多