'Xcode 13.3 and 13.2 build for simulator but not for real device

I recently had my phone updated to iOS 15.4 and so I need to update Xcode to 13.3.

I ran into a problem where my code does build on x86_64 simulator but the same code when archiving or building to "any iOS device" hangs indefenitively no error no nothing.

I tried with Xcode 13.2 and 13.3 the only way I found to be able to build something and archive is building with Xcode 13.1. I do not know if there are compiler update or new option but I am stuck and lost a day looking for an answer. Did sb had the problem and found a solution ?

EDIT:

I spend the day looking for what can be the cause of the problem. I do thinks that the compiler algorithm has changed and is less performant at dealing with circular references.

My method : I started a new project and moved all of my components one by one. Doing clean build folder and recompiling at each feature I added. At some point my build time jumped from 5 sec to 150sec with the addition of one file that uses some other structs I added.

When removing all functions, members that uses my custom time, keeping only Strings, Ints and Arrays. My build time came back to 5sec. Adding a single reference to a custom type that I know is dependent of other tipes (its a Backoffice Model) sends the build time to the 100+ sec.

Is It possible to get to the 13.2 build algorithm ? With that one it takes me only 30 sec to build the entire project.



Solution 1:[1]

Today I tried with Xcode 13.4 RC and the build went successful in a reasonable time (less than 5 min as always)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 FitzChill