【问题标题】:XCTest: running tests fails with Cycle inside X; building could produce unreliable results in project with CocoaPods and CarthageXCTest:运行测试失败,X 内有 Cycle;在使用 CocoaPods 和 Carthage 的项目中,建筑可能会产生不可靠的结果
【发布时间】:2021-02-09 19:58:11
【问题描述】:

将我的项目升级到 Xcode 12 后,测试套件停止工作。测试目标没有编译,失败:

Cycle inside <redacted>Tests; building could produce unreliable results. This usually can be resolved by moving the shell script phase '[CP] Embed Pods Frameworks' so that it runs before the build phase that depends on its outputs.
Cycle details:
→ Target '<redacted>Tests' has copy command from '/Applications/Xcode12.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks/XCTAutomationSupport.framework' to '<redacted>/Library/Developer/Xcode/DerivedData/<redacted>-bxjgdjscysiavpfrzmquaqdkncsl/Build/Products/Debug-iphonesimulator/<redacted>.app/Frameworks/XCTAutomationSupport.framework'
○ Target '<redacted>Tests': CodeSign <redacted>/Library/Developer/Xcode/DerivedData/<redacted>-bxjgdjscysiavpfrzmquaqdkncsl/Build/Products/Debug-iphonesimulator/<redacted>.app/PlugIns/<redacted>Tests.xctest/Frameworks/CryptoSwift.framework
○ That command depends on command in Target '<redacted>Tests': script phase “[CP] Embed Pods Frameworks”

脚本是目标中的最后一个构建阶段,所以我有点迷茫。有什么线索吗?谢谢。

【问题讨论】:

    标签: xcode cocoapods xctest carthage


    【解决方案1】:

    我找到了解决问题的方法。错误是提到CodeSign 并且它与Frameworks/CryptoSwift.framework 相关(这个框架是使用 Carthage 链接的),所以我猜它与 CocoaPods 无关,而是与 Carthage 框架包含在测试包中的方式有​​关。

    只需从 Carthage 构建阶段中删除“Code Sign On Copy”即可。

    【讨论】:

      猜你喜欢
      • 2019-02-22
      • 2022-07-06
      • 2018-11-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-02-07
      • 2016-04-08
      • 2015-05-11
      相关资源
      最近更新 更多