animekun
animekun

Reputation: 1869

Forms App crashes after splash screen on iOS device

I have an Xamarin Forms app, that works perfectly on Android and iOS emulators, but if I try to deploy it on iOS device it crashes once I see my first screen.

sometimes it writes in log a MT1107 error, but sometimes not

here is my iOS device log: http://pastebin.com/uGp5K7Pg

Upvotes: 2

Views: 879

Answers (1)

Krumelur
Krumelur

Reputation: 33048

Check line 70 of your PasteBin:

Sequence contains no elements (System.InvalidOperationException)
at System.Linq.Enumerable.Last[UIViewController] (IEnumerable`1 source) [0x00000] in <filename unknown>:0
at Xamarin.Forms.Platform.iOS.NavigationRenderer.<.ctor>b__0 (Xamarin.Forms.Platform.iOS.TabletMasterDetailRenderer sender) [0x00000] in <filename unknown>:0
at Xamarin.Forms.MessagingCenter+<>c__DisplayClass4`1[Xamarin.Forms.Platform.iOS.TabletMasterDetailRenderer].<Subscribe>b__3 (System.Object sender, System.Object args) [0x00000] in <filename unknown>:0

It seems you are wrapping a MasterDetailPage into a NavigationPage. On iOS (more specifically: iPad), this uses a UISplitViewController, which must not be embedded into a UINavigationController. Xamarin.Forms uses the native controls whenever possible.

Try checking the device OS and idiom: if you are on iPad, don't wrap a NavigationPage around your pages.

Upvotes: 4

Related Questions