Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 542
Greg Whatley Avatar asked Nov 09 '16 13:11

Greg Whatley


1 Answers

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.

like image 182
Greg Whatley Avatar answered Nov 09 '22 11:11

Greg Whatley