3

I am getting the following error only on Xcode 13.4.1 when I am trying to build the project.

Cycle in dependencies between targets '#aTargetName' and '#anotherTargetName'; building could produce unreliable results. This usually can be resolved by moving the target's Headers build phase before Compile Sources.

It gets solved if I "clean build folder" every time I need to run the project.

This is how the build phases are in the project:

enter image description here

***Update on 1/07/22: The following line fix this: Open Terminal and run: defaults write com.apple.dt.XCBuild EnableSwiftBuildSystemIntegration 1

Luciano Perez
  • 101
  • 1
  • 10

1 Answers1

1

I had the same error. All the other SO questions refer to changing the order of the 'Headers' in the build phases or updating the build system to legacy.

I don't have a Headers phase so I just played around with what phases I did have. This is a daunting suggestion for anyone with more a few phases because permutations grow exponentially.

For myself here is the before (not working) and after (working) configuration.

Not Working Not Working Build Phases Working Working Build Phases

I have no idea why one is working and the other isn't just that this change resolved my issue. I also commented out some localizing and linting scripts that aren't essential to run on release just dev/test builds. I also only got the error when arching the project - not when buildling.

Sean Dev
  • 1,239
  • 1
  • 17
  • 31