XCTest:运行测试失败,并在X内循环;CocoaPods和Carthage的建筑可能会产生不可靠的结果 [英] XCTest: running tests fails with Cycle inside X; building could produce unreliable results in project with CocoaPods and Carthage

查看:60
本文介绍了XCTest:运行测试失败,并在X内循环;CocoaPods和Carthage的建筑可能会产生不可靠的结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将项目升级到Xcode 12后,测试套件停止工作.测试目标无法编译,失败:

After upgrading my project to Xcode 12, the test suite stopped working. The tests target doesn't compile, fails with:

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"

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

The script is the last build phase in the target so I'm a bit lost. Any clue? Thank you.

推荐答案

我为我的问题找到了解决方案.错误是提到 CodeSign ,它与 Frameworks/CryptoSwift.framework (此框架使用迦太基链接)有关,所以我猜想它与CocoaPods没有关系,但是将迦太基框架包含在测试包中的方式.

I found a solution for my issue. The error is mentioning CodeSign and it is related with Frameworks/CryptoSwift.framework (this framework is linked using Carthage), so I guessed that it has nothing to do with CocoaPods but with the way that Carthage frameworks are included in the test bundle.

只需删除代码登录副本"从迦太基的建造阶段开始.

Just remove the "Code Sign On Copy" from the Carthage build phase.

这篇关于XCTest:运行测试失败,并在X内循环;CocoaPods和Carthage的建筑可能会产生不可靠的结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆