问题
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.
回答1:
I found 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 why that Carthage frameworks are included in the test bundle.
Just remove the "Code Sign On Copy" from the Carthage build phase.
来源:https://stackoverflow.com/questions/64556134/xctest-running-tests-fails-with-cycle-inside-x-building-could-produce-unreliab