Xcode Version 13.3 (13E113) error - Cycle in dependencies

Hi all,
I’m getting this error in Xcode 13.3.

Cycle in dependencies between targets ‘Unity-iPhone’ and ‘UnityFramework’; building could produce unreliable results. This usually can be resolved by moving the target’s Headers build phase before Compile Sources.
Cycle path: Unity-iPhone → UnityFramework → Unity-iPhone
Cycle details:

This seems to happen on any build after the first and can be resolved with Product/Clean Build Folder.
I was wondering if anyone knows a way to automate this step as I need my builds to make it through unattended.

Thanks,
Pete

1 Like

I reported this issue to Apple, and they replied that it’s from the UnityFramework’s “build phases” having the “Headers” after the “Compile Sources”. When rearranged so that Headers is before Compile Sources, this issue no longer happens.

I did ask in a followup why it works the first time after a “Clean Build Folder”, and pointed out that it just started in a recent Xcode version. I expect finger-pointing to happen between Apple and Unity before we get a good solution.

I would love to hear from Unity on this here.

5 Likes

Hey thanks @Gillissie , good that you let them know. It doesn’t sound like it’ll be too much trouble for Unity to fix, I’ll post here if I manage to find anything.

I’m running into this same issue. I’m new to Mac OS, just got my mac book pro this weekend and trying to learn all of this so I can build to ios. Would you mind explaining how to rearrange the headers and compile sources in xcode? Thanks!

8064536--1041731--Screen Shot 2022-04-20 at 12.26.50 PM.jpg

31 Likes

I feel like we should also report this as a bug in Unity, since the Xcode project should generate properly to build without issues.

1 Like

By the way, this is Apple’s response to my report:

I reminded them that this issue just started in Xcode 13.3, so it seems like they should fix that. However, I also think Unity should fix their iOS builds so the build phases are in the correct order.

Thanks for the pointers!
I made a Unity bug report so hopefully that’s of some help.

1 Like

Gillissie workaround above is the one recommended by apple, and we are indeed fixing this internally (no ETA for now, but indeed it would be easier for everyone if we just fixed the project by ourselves)

7 Likes

Thanks!

You are the man! I love the great way to show this, I’m new to Xcode myself but that is just the amazing compared to other documents I could be searching through!

@Gillissie solution works. Thanks!

But hope Unity will fix this soon too.

I have since upgraded to Unity 2021.3.5f1 and it does appear to be fixed.

1 Like

XCode 13.4.1still has this issue
This seems to occur after build to Mac, then build to iOS after

Clean build seems to fix it

I did a build from newest version of unity, and opened a Xcode workspace project and after the indexing, went to do a build onto my phone and got this error. I’m using Xcode 13.4 Just updated, never had this issue before, I’m trying to fix of moving the headers. When it went to install after doing so. I get this error and this debug log

Details

The app “HauntedEscapesHDR” on iPhone quit unexpectedly.
Domain: IDEDebugSessionErrorDomain
Code: 10
Failure Reason: Message from debugger: Terminated due to memory issue
User Info: {
    DVTErrorCreationDateKey = "2022-08-28 18:13:30 +0000";
    IDERunOperationFailingWorker = DBGLLDBLauncher;
}
--

Analytics Event: com.apple.dt.IDERunOperationWorkerFinished : {
    "device_model" = "iPhone14,2";
    "device_osBuild" = "15.4.1 (19E258)";
    "device_platform" = "com.apple.platform.iphoneos";
    "launchSession_schemeCommand" = Run;
    "launchSession_state" = 2;
    "launchSession_targetArch" = arm64;
    "operation_duration_ms" = 16422;
    "operation_errorCode" = 10;
    "operation_errorDomain" = IDEDebugSessionErrorDomain;
    "operation_errorWorker" = DBGLLDBLauncher;
    "operation_name" = IDEiPhoneRunOperationWorkerGroup;
    "param_consoleMode" = 0;
    "param_debugger_attachToExtensions" = 0;
    "param_debugger_attachToXPC" = 0;
    "param_debugger_type" = 5;
    "param_destination_isProxy" = 0;
    "param_destination_platform" = "com.apple.platform.iphoneos";
    "param_diag_MainThreadChecker_stopOnIssue" = 0;
    "param_diag_MallocStackLogging_enableDuringAttach" = 0;
    "param_diag_MallocStackLogging_enableForXPC" = 1;
    "param_diag_allowLocationSimulation" = 1;
    "param_diag_gpu_frameCapture_enable" = 3;
    "param_diag_gpu_shaderValidation_enable" = 0;
    "param_diag_gpu_validation_enable" = 1;
    "param_diag_memoryGraphOnResourceException" = 0;
    "param_diag_queueDebugging_enable" = 0;
    "param_diag_runtimeProfile_generate" = 0;
    "param_diag_sanitizer_asan_enable" = 0;
    "param_diag_sanitizer_tsan_enable" = 0;
    "param_diag_sanitizer_tsan_stopOnIssue" = 0;
    "param_diag_sanitizer_ubsan_stopOnIssue" = 0;
    "param_diag_showNonLocalizedStrings" = 0;
    "param_diag_viewDebugging_enabled" = 1;
    "param_diag_viewDebugging_insertDylibOnLaunch" = 1;
    "param_install_style" = 0;
    "param_launcher_UID" = 2;
    "param_launcher_allowDeviceSensorReplayData" = 0;
    "param_launcher_kind" = 0;
    "param_launcher_style" = 0;
    "param_launcher_substyle" = 0;
    "param_runnable_appExtensionHostRunMode" = 0;
    "param_runnable_productType" = "com.apple.product-type.application";
    "param_runnable_swiftVersion" = "5.6.1";
    "param_runnable_type" = 2;
    "param_testing_launchedForTesting" = 0;
    "param_testing_suppressSimulatorApp" = 0;
    "param_testing_usingCLI" = 0;
    "sdk_canonicalName" = "iphoneos15.5";
    "sdk_osVersion" = "15.5";
    "sdk_variant" = iphoneos;
}
--


System Information

macOS Version 12.5.1 (Build 21G83)
Xcode 13.4.1 (20504) (Build 13F100)
Timestamp: 2022-08-28T14:13:30-04:00

THANKS