Received an NSInternalInconsistencyException in the iOS Simulator (Xcode v9.1) with Unity 2017.2 using a MacBook Pro (Retina, 15-inch, Late 2013) running High Sierra (10.13.1). The build is set to Metal only. If I build with Metal and OpenGL ES 3, this error will not happen. However, I need to test Metal in the simulator and if I build with both it will select OpenGL ES 3. My video card (NVIDIA GeForce GT 750M) does support Metal and I am able to use the Metal GUI for Unity. I do not see any errors if I build for device (sadly I won’t have a device that supports Metal for a few weeks).
Uncaught exception: NSInternalInconsistencyException: [UnityAppController renderingAPI] called before [UnityAppController selectRenderingApi]
(
0 CoreFoundation 0x00000001168501ab __exceptionPreprocess + 171
1 libobjc.A.dylib 0x0000000115eedf41 objc_exception_throw + 48
2 CoreFoundation 0x0000000116855372 +[NSException raise:format:arguments:] + 98
3 Foundation 0x000000011281b089 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 193
4 AfaTest01 0x000000010a20a3a4 -[UnityAppController(Rendering) renderingAPI] + 260
5 AfaTest01 0x000000010a221612 -[UnityAppController application:didFinishLaunchingWithOptions:] + 898
6 UIKit 0x0000000113910c12 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 267
7 UIKit 0x000000011391266f -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4105
8 UIKit 0x0000000113917afd -[UIApplication _runWithMainScene:transitionContext:completion:] + 1720
9 UIKit 0x0000000113cdd2e0 __111-[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:]_block_invoke + 924
10 UIKit 0x00000001140afbe0 +[_UICanvas _enqueuePostSettingUpdateTransactionBlock:] + 153
11 UIKit 0x0000000113cdced9 -[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:] + 249
12 UIKit 0x0000000113cdd737 -[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:] + 668
13 UIKit 0x0000000114651c4d __82-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:]_block_invoke + 262
14 UIKit 0x0000000114651b06 -[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] + 444
15 UIKit 0x0000000114332d52 __125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke + 420
16 UIKit 0x000000011452fa7e _performActionsWithDelayForTransitionContext + 100
17 UIKit 0x0000000114332b4e -[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:] + 231
18 UIKit 0x00000001140af23d -[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:] + 392
19 UIKit 0x000000011391637e -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 523
20 UIKit 0x0000000113eeac1b -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 369
21 FrontBoardServices 0x0000000119571158 -[FBSSceneImpl _didCreateWithTransitionContext:completion:] + 338
22 FrontBoardServices 0x0000000119579c4d __56-[FBSWorkspace client:handleCreateScene:withCompletion:]_block_invoke_2 + 235
23 libdispatch.dylib 0x0000000117a802b5 _dispatch_client_callout + 8
24 libdispatch.dylib 0x0000000117a85565 _dispatch_block_invoke_direct + 324
25 FrontBoardServices 0x00000001195a5672 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 24
26 FrontBoardServices 0x00000001195a5328 -[FBSSerialQueue _performNext] + 464
27 FrontBoardServices 0x00000001195a5897 -[FBSSerialQueue _performNextFromRunLoopSource] + 45
28 CoreFoundation 0x00000001167f3231 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
29 CoreFoundation 0x0000000116892e41 __CFRunLoopDoSource0 + 81
30 CoreFoundation 0x00000001167d7b49 __CFRunLoopDoSources0 + 185
31 CoreFoundation 0x00000001167d712f __CFRunLoopRun + 1279
32 CoreFoundation 0x00000001167d69b9 CFRunLoopRunSpecific + 409
33 GraphicsServices 0x0000000116eec9c6 GSEventRunModal + 62
34 UIKit 0x00000001139195e8 UIApplicationMain + 159
35 AfaTest01 0x000000010a1facd4 main + 212
36 libdyld.dylib 0x0000000117af4d81 start + 1
37 ??? 0x0000000000000001 0x0 + 1
)
2017-11-13 17:16:22.677265-0500 AfaTest01[28324:928555] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '[UnityAppController renderingAPI] called before [UnityAppController selectRenderingApi]'
*** First throw call stack:
(
0 CoreFoundation 0x00000001168501ab __exceptionPreprocess + 171
1 libobjc.A.dylib 0x0000000115eedf41 objc_exception_throw + 48
2 CoreFoundation 0x0000000116855372 +[NSException raise:format:arguments:] + 98
3 Foundation 0x000000011281b089 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 193
4 AfaTest01 0x000000010a20a3a4 -[UnityAppController(Rendering) renderingAPI] + 260
5 AfaTest01 0x000000010a221612 -[UnityAppController application:didFinishLaunchingWithOptions:] + 898
6 UIKit 0x0000000113910c12 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 267
7 UIKit 0x000000011391266f -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4105
8 UIKit 0x0000000113917afd -[UIApplication _runWithMainScene:transitionContext:completion:] + 1720
9 UIKit 0x0000000113cdd2e0 __111-[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:]_block_invoke + 924
10 UIKit 0x00000001140afbe0 +[_UICanvas _enqueuePostSettingUpdateTransactionBlock:] + 153
11 UIKit 0x0000000113cdced9 -[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:] + 249
12 UIKit 0x0000000113cdd737 -[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:] + 668
13 UIKit 0x0000000114651c4d __82-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:]_block_invoke + 262
14 UIKit 0x0000000114651b06 -[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] + 444
15 UIKit 0x0000000114332d52 __125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke + 420
16 UIKit 0x000000011452fa7e _performActionsWithDelayForTransitionContext + 100
17 UIKit 0x0000000114332b4e -[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:] + 231
18 UIKit 0x00000001140af23d -[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:] + 392
19 UIKit 0x000000011391637e -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 523
20 UIKit 0x0000000113eeac1b -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 369
21 FrontBoardServices 0x0000000119571158 -[FBSSceneImpl _didCreateWithTransitionContext:completion:] + 338
22 FrontBoardServices 0x0000000119579c4d __56-[FBSWorkspace client:handleCreateScene:withCompletion:]_block_invoke_2 + 235
23 libdispatch.dylib 0x0000000117a802b5 _dispatch_client_callout + 8
24 libdispatch.dylib 0x0000000117a85565 _dispatch_block_invoke_direct + 324
25 FrontBoardServices 0x00000001195a5672 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 24
26 FrontBoardServices 0x00000001195a5328 -[FBSSerialQueue _performNext] + 464
27 FrontBoardServices 0x00000001195a5897 -[FBSSerialQueue _performNextFromRunLoopSource] + 45
28 CoreFoundation 0x00000001167f3231 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
29 CoreFoundation 0x0000000116892e41 __CFRunLoopDoSource0 + 81
30 CoreFoundation 0x00000001167d7b49 __CFRunLoopDoSources0 + 185
31 CoreFoundation 0x00000001167d712f __CFRunLoopRun + 1279
32 CoreFoundation 0x00000001167d69b9 CFRunLoopRunSpecific + 409
33 GraphicsServices 0x0000000116eec9c6 GSEventRunModal + 62
34 UIKit 0x00000001139195e8 UIApplicationMain + 159
35 AfaTest01 0x000000010a1facd4 main + 212
36 libdyld.dylib 0x0000000117af4d81 start + 1
37 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException