SwiftUI Preview not rendering

159 views Asked by At

I am trying to use SwiftUI in my project where I was using UIKit only, until now. The problem is that Preview in Xcode is not working even for very simple View with Text("Hello World"). Code is correct and project is possible to build and run. Even when I try to select real device (real iPhone) I can see Preview in my device. But Preview in simulator is not working. Can someone help me with this? I am attaching diagnostic from Xcode. Thanks for help

enter image description here

Edit: I removed most of the packages used via SPM and remove almost all custom code from AppDelegate but it didn't helped. But It made diagnostic from Xcode Preview much shorter. So maybe it could help more now.

1

There are 1 answers

0
Libor Zapletal On

Thank you for your assistance. It took me a while, but I finally figured out where the issue was. I had to reduce the entire project to its bare minimum, and only then did I discover that the problem likely lay somewhere in the configuration. The issue was that 'arm64' was listed under Excluded Architectures. Since I inherited the project, I was unaware of this setting. It's a pity that Xcode doesn't indicate such reasons, as it would simplify the process of identifying problems.