Xcode 15: "Cycle inside ...; building could produce unreliable results" due to DSTROOT=/

Offering this here for those who may run into the same issue... There is more than one reason you may get the following error message when attempting to build your targets:

Cycle inside ...; building could produce unreliable results

But if you just switched to Xcode 15 and you are currently customizing DSTROOT to set the root install location for the deliverables (app, bundle, etc) built by your Target, Xcode 15 will refuse to build any target with dependencies on other targets that use the same underlying configuration. There is obviously no real cycle: Xcode 15 is just confused by both targets sharing the same DSTROOT. For example, if you set up your projects with:

DSTROOT=/
INSTALL_PATH=/Applications

(notice that DSTROOT=/ is even mentioned in the docs)

Xcode will wrongfully detect a circular dependency as both targets share the build destination and thus refuse to build. The solution is to not customize DSTROOT, thus allowing it to have a directory name that is target-dependent and thus fairly immune to collisions. Instead, customize the INSTALL_ROOT setting. While this setting does not appear in the Build Phases tab, it defaults to reusing the DSTROOT value. If you set it explicitly, it allows DSTROOT to remain for other purposes, while using the value of INSTALL_ROOT to deploy your deliverables:

INSTALL_ROOT=/
INSTALL_PATH=/Applications

This allows the build system to proceed without errors.

Answered by .jeroen. in 755002022

Update: we managed to fix the issue on our end by moving the 'Embed Frameworks' build phase above the 'Run script' build phase(s).

Like FxFactory said (thank you dear stranger on the internet very much!), that solution worked! To set it:

  1. Build Settings
  2. Plus in top left
  3. User Defined Setting

Type INSTALL_ROOT in and for the field (should have a green outline), add "/"

And then I used this build phases (though I think it was setting):

It absolutely works for me... Thanks for providing so clearly the solution....

Xcode 15: "Cycle inside ...; building could produce unreliable results" due to DSTROOT=/
 
 
Q