App hanging in XCode simulator

My app suddenly won't run on the simulator. It still runs on my iPhone, but if I try to run it in the simulator it just freezes. The UI comes up but it's completely unresponsive and I can't tap anything. If I pause the project and look at the call stack I see a message saying "Application violated contract by causing UIApplicationMain() to return. This incident will be reported.". And in the console the last message I get is "void * _Nullable NSMapGet(NSMapTable * _Nonnull, const void * _Nullable): map table argument is NULL". Not sure if those are related but that's all I could find.

Post not yet marked as solved Up vote post of coderkid Down vote post of coderkid
2.5k views

Replies

seeing the same message in debugger for mac catalyst app: Application violated contract by causing UIApplicationMain() to return. This incident will be reported.

any resolution on your side>

FYI i deleted the app container and re-launched and it worked (this is mac catalyst)

i suspect some mac window settings like position etc are stored in there and may have gotten trashed due to repeated launching & killing of the app when in the debugger

e.g. look for the directory

~/Library/Containers/yourappbundleid

get rid of it

make sure first there is no data you need in there :)