2
votes

Need help. receiving below error while launching the application

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 0x00000001160421e6 exceptionPreprocess + 294 1 libobjc.A.dylib 0x0000000116fdf031 objc_exception_throw + 48 2 CoreFoundation 0x0000000116047472 +[NSException raise:format:arguments:] + 98 3 Foundation 0x0000000114f7b652 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 193 4 UIKit 0x0000000112d1bb96 -[UIApplication _runWithMainScene:transitionContext:completion:] + 3064 5 UIKit 0x00000001130dde4a __111-[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:]_block_invoke + 866 6 UIKit 0x00000001134b0909 +[_UICanvas _enqueuePostSettingUpdateTransactionBlock:] + 153 7 UIKit 0x00000001130dda86 -[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:] + 236 8 UIKit 0x00000001130de2a7 -[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:] + 675 9 UIKit 0x0000000113a4f4d4 __82-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:]_block_invoke + 299 10 UIKit 0x0000000113a4f36e -[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] + 433 11 UIKit 0x000000011373362d __125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke + 221 12 UIKit 0x000000011392e387 _performActionsWithDelayForTransitionContext + 100 13 UIKit 0x00000001137334f7 -[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:] + 223 14 UIKit 0x00000001134affb0 -[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:] + 392 15 UIKit 0x0000000112d19f0c -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 515 16 UIKit 0x00000001132eca97 -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 361 17 FrontBoardServices 0x000000011d9c32f3 -[FBSSceneImpl _didCreateWithTransitionContext:completion:] + 331 18 FrontBoardServices 0x000000011d9cbcfa __56-[FBSWorkspace client:handleCreateScene:withCompletion:]_block_invoke_2 + 225 19 libdispatch.dylib 0x0000000117c74779 _dispatch_client_callout + 8 20 libdispatch.dylib 0x0000000117c79931 _dispatch_block_invoke_direct + 317 21 FrontBoardServices 0x000000011d9f7470 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK + 24 22 FrontBoardServices 0x000000011d9f712e -[FBSSerialQueue _performNext] + 439 23 FrontBoardServices 0x000000011d9f768e -[FBSSerialQueue _performNextFromRunLoopSource] + 45 24 CoreFoundation 0x0000000115fe4bb1 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17 25 CoreFoundation 0x0000000115fc94af __CFRunLoopDoSources0 + 271 26 CoreFoundation 0x0000000115fc8a6f __CFRunLoopRun + 1263 27 CoreFoundation 0x0000000115fc830b CFRunLoopRunSpecific + 635 28 GraphicsServices 0x0000000119779a73 GSEventRunModal + 62 29 UIKit 0x0000000112d1d0b7 UIApplicationMain + 159 30 ??? 0x000000013437347e 0x0 + 5171000446 31 ??? 0x0000000134373213 0x0 + 5170999827

1
The question does not have sufficient information for providing the details.hashimks

1 Answers

0
votes

Application windows are expected to have a root view controller at the end of application

It seems that you didn't set the RootViewController.It worked fine in old version.But in the new version ,you should set it in AppDelegate

public override bool FinishedLaunching (UIApplication application, NSDictionary launchOptions)
{
  // Override point for customization after application launch.
  // If not required for your application you can safely delete this method

  var indexVC = new XXXViewController ();//your viewcontroller
  Window = new UIWindow ((CGRect)UIScreen.MainScreen.Bounds);
  Window .RootViewController = indexVC;
  Window .MakeKeyAndVisible ();

  return true;
}