在 iOS 台设备上出现启动画面后 Forms 应用程序崩溃

Forms App crashes after splash screen on iOS device

我有一个 Xamarin Forms 应用程序,可以在 Android 和 iOS 模拟器上完美运行,但是如果我尝试将它部署到 iOS 设备上,它会在我第一次看到它时崩溃屏幕.

有时它会在日志中写入 MT1107 错误,但有时不会

这是我的 iOS 设备日志: http://pastebin.com/uGp5K7Pg

检查您的 PasteBin 的第 70 行:

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

您似乎将 MasterDetailPage 包装成 NavigationPage。在 iOS 上(更具体地说:iPad),这使用了 UISplitViewController,它不能嵌入到 UINavigationController 中。 Xamarin.Forms 尽可能使用本机控件。

尝试检查设备 OS 和习惯用法:如果您使用的是 iPad,请不要在您的页面周围环绕 NavigationPage