I'm developing a SwiftUI App for macOS in Xcode 13.2.
When I try to run the App in Xcode, I get this error messages in the console and the app terminates:
2021-12-28 13:13:21.680087+0100 MyAppProject[21343:363165] [CK] Giving up waiting to register for remote notifications
2021-12-28 13:13:23.548389+0100 MyAppProject[21343:362383] Unable to load nib file: MyAppStartViewName, exiting
Until now, the error happend sporadically. Now I use a new MacBookPro with M1max and the error happens every time. As it is a SwiftUI App, there is no nib file at all. I didn't find any information about SwiftUI generating a nib file...
How can I prevent the bug and get the App running? Any hints are welcome :-)
I found the problem :-)
During the initialization of the model of the @main view I did some longer running tasks to initialize some background processes. Now I run them on a background task using perform{} and the bug is gone.
The reason why the bug appeared on my new, faster hardware obviously was the addition of more data structures to be initialized, so it took longer.