【发布时间】:2017-06-12 00:33:06
【问题描述】:
已解决:
如果您在使用 Xamarin Forms 时遇到此错误,您可能应该检查您的初始页面是否正确构建。当 XF 无法创建您的初始页面并继续运行时,就会发生这种情况。这似乎是 Xamarin Forms 无法正确显示错误的另一种情况,这给很多用户在调试时带来了很大的痛苦。
- 平台:Xamarin 表单(iOS 和 Android)
- 棱镜版本:6.2.0
- Xamarin 表单版本:2.3.3.180
- Visual Studio 2015
- Xamarin Studio 6.1.5
抱歉,我是开发移动应用程序的新手。更新 Xamarin Studio、Xamarin Forms、Xamarin for Visual Studio 后出现问题。似乎无法为这个特定问题找到解决方案;所有答案都指向一般更改 Xamarin iOS 或 iOS Xcode 的 AppDelegate FinishedLaunching。
Unhandled Exception:
Foundation.MonoTouchException: Objective-C exception thrown. Name: NSInternalInconsistencyException Reason: Application windows are expected to have a root view controller at the end of application launch
Native stack trace:
0 CoreFoundation 0x0000000109556d4b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x0000000113f5621e objc_exception_throw + 48
2 CoreFoundation 0x000000010955ae42 +[NSException raise:format:arguments:] + 98
3 Foundation 0x000000010a13b66d -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 195
4 UIKit 0x000000010ce3091d -[UIApplication _runWithMainScene:transitionContext:completion:] + 3827
5 UIKit 0x000000010ce2d26d -[UIApplication workspaceDidEndTransaction:] + 188
6 FrontBoardServices 0x0000000116c7f6cb __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 24
7 FrontBoardServices 0x0000000116c7f544 -[FBSSerialQueue _performNext] + 189
8 FrontBoardServices 0x0000000116c7f8cd -[FBSSerialQueue _performNextFromRunLoopSource] + 45
9 CoreFoundation 0x00000001094fb761 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
10 CoreFoundation 0x00000001094e098c __CFRunLoopDoSources0 + 556
11 CoreFoundation 0x00000001094dfe76 __CFRunLoopRun + 918
12 CoreFoundation 0x00000001094df884 CFRunLoopRunSpecific + 420
13 UIKit 0x000000010ce2baea -[UIApplication _run] + 434
14 UIKit 0x000000010ce31c68 UIApplicationMain + 159
15 ??? 0x000000012c49543c 0x0 + 5037970492
16 ??? 0x000000012c4950ad 0x0 + 5037969581
【问题讨论】:
-
从第一个猜测开始,听起来您并没有为应用程序的启动设置页面。您是完全告诉 prism 以
.NavigateAsync()开始,还是将MainPage设置为您的一个页面的新实例?如果您向我们展示一些来自AppDelegate.cs的代码可能会有所帮助,也可能是App.cs,我猜它会继承自PrismApplication?
标签: ios xamarin.ios xamarin.forms prism visual-studio-2015