gpt4 book ai didi

ios - Xamarin Prism 形式 : Application windows are expected to have a root view controller at the end of application launch

转载 作者:可可西里 更新时间:2023-11-01 05:18:28 27 4
gpt4 key购买 nike

Solved:

If you are having this error when using Xamarin Forms you should probably check if your initial page is properly constructed. This happens when XF fails to create your initial page and just continues running. It seems that this another case where Xamarin Forms fails to properly display the error which causes a lot of pain to a lot of users when debugging.

  • 平台:Xamarin Forms(iOS 和 Android)
  • Prism 版本: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

最佳答案

可能是以下问题:

  1. 您忘记为导航注册您的 View
  2. 您忘记向 DI 容器注册类型
  3. 您的 View 或 ViewModel 中有一个 Null Reference 或其他异常被抛出。请注意,由于自定义控件或您在 View 中使用的其他扩展方法,可能会引发异常。
  4. .xaml 有错误 - 尝试注释掉代码的一部分
  5. 确保您的 app.xaml.cs 中确实有一个根页面 NavigationService.NavigateAsync("/HomePage");
  6. 如果它在 App.xaml.cs

    中失败,此函数可能会帮助您找到失败的真正原因
    protected override async void OnInitialized()
    {
    try
    {
    TaskScheduler.UnobservedTaskException += (sender, e) => {
    Logger.Log(e.Exception.ToString(), Category.Exception, Priority.High);
    };
    await NavigationService.NavigateAsync("HomePage");
    }
    catch(Exception e)
    {
    Logger.Log(e.ToString(), Category.Exception, Priority.High);
    }
    }

关于ios - Xamarin Prism 形式 : Application windows are expected to have a root view controller at the end of application launch,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41875133/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com