Greg Whatley
Greg Whatley

Reputation: 1050

UIApplication Assertion Failure in Xamarin.iOS App

I was in the middle of developing an update to my Xamarin Forms app, but when I debugged it on my iPhone, it crashed immediately on startup with the following message:

Assertion failure in -[UIApplication_runWithMainScene:transitionContext:completion:], /BuildRoot/Library/Caches/com/apple.xbs/Source/UIKit/UIKit-3600.5.2/UIApplication.m:3679

It was previously working fine, but now I can't run the app on my phone anymore without this crash. I have rebuilt several times and deployed from different computers, but nothing helps. How do I fix this issue?

Edit:
Before this started occurring, I had made some additions to the code. Unfortunately, after removing all of my changes, this issue is still plaguing further development. Any help or resource that might lead me to a solution will be greatly appreciated.

Upvotes: 6

Views: 2942

Answers (2)

Abhijith C R
Abhijith C R

Reputation: 1610

This can also happen if you are not quick to launch a view. Avoid calling APIs or other lengthy processes before a page is displayed for the first time. You may do that in parallel but not in the same thread that launches the page.

Upvotes: 0

Greg Whatley
Greg Whatley

Reputation: 1050

After some deep searching, it turns out that I mistakenly removed a part of my Application's constructor that initialized the MainPage. As a result, MainPage remained null. The framework probably tried to call a method or access a property without checking if the reference was null, causing the error. I'm not sure how long that mistake has been there.

Upvotes: 6

Related Questions