Xamarin IOS:在bundle NSBundle 中找不到名为"Main"的故事板



我正试图通过macos上的visual studio社区运行Xamarin.IOS应用程序,但在模拟器和物理设备上的启动屏幕上都遇到了以下异常。它以前是有效的,但在推动变革(有效)并休息了一段时间后,我下一次构建它时就停止了工作。主存储库没有VCS差异,这对同事来说运行良好。

Objective-C exception thrown.  Name: NSInvalidArgumentException Reason: Could not find a storyboard named 'Main' in bundle NSBundle </Users/User/Library/Developer/CoreSimulator/Devices/3AD1FBAC-EA67-4CC0-8D8D-212DA5429B51/data/Containers/Bundle/Application/7D30F8AC-D3A4-46FA-AA22-8EA50F1ABA43/Test.app> (loaded)
Native stack trace:
0   CoreFoundation                      0x000000011bc371bb __exceptionPreprocess + 331
1   libobjc.A.dylib                     0x000000011cc18735 objc_exception_throw + 48
2   UIKitCore                           0x000000012312e27a +[UIStoryboard storyboardWithName:bundle:] + 676
3   UIKitCore                           0x0000000122f8d016 -[UIApplication _loadMainStoryboardFileNamed:bundle:] + 76
4   UIKitCore                           0x0000000122f8d50c -[UIApplication _loadMainInterfaceFile] + 272
5   UIKitCore                           0x0000000122f8bb25 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1357
6   UIKitCore                           0x00000001227aa4e9 __111-[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:]_block_invoke + 866
7   UIKitCore                           0x00000001227b329c +[_UICanvas _enqueuePostSettingUpdateTransactionBlock:] + 153
8   UIKitCore                           0x00000001227aa126 -[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:] + 233
9   UIKitCore                           0x00000001227aaae0 -[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:] + 1085
10  UIKitCore                           0x00000001227a8cb5 __82-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:]_block_invoke + 795
11  UIKitCore                           0x00000001227a895f -[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] + 435
12  UIKitCore                           0x00000001227ada90 __125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke + 584
13  UIKitCore                           0x00000001227ae80e _performActionsWithDelayForTransitionContext + 100
14  UIKitCore                           0x00000001227ad7ef -[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:] + 221
15  UIKitCore                           0x00000001227b293a -[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:] + 392
16  UIKitCore                           0x0000000122f8a44e -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 515
17  UIKitCore                           0x0000000122b2ed09 -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 357
18  FrontBoardServices                  0x000000011e76a2da -[FBSSceneImpl _didCreateWithTransitionContext:completion:] + 448
19  FrontBoardServices                  0x000000011e775443 __56-[FBSWorkspace client:handleCreateScene:withCompletion:]_block_invoke_2 + 271
20  FrontBoardServices                  0x000000011e774b3a __40-[FBSWorkspace _performDelegateCallOut:]_block_invoke + 53
21  libdispatch.dylib                   0x000000011df3a54b _dispatch_client_callout + 8
22  libdispatch.dylib                   0x000000011df3d60b _dispatch_block_invoke_direct + 312
23  FrontBoardServices                  0x000000011e7a9ba8 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 30
24  FrontBoardServices                  0x000000011e7a9860 -[FBSSerialQueue _performNext] + 457
25  FrontBoardServices                  0x000000011e7a9e40 -[FBSSerialQueue _performNextFromRunLoopSource] + 45
26  CoreFoundation                      0x000000011bb9c721 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
27  CoreFoundation                      0x000000011bb9bf93 __CFRunLoopDoSources0 + 243
28  CoreFoundation                      0x000000011bb9663f __CFRunLoopRun + 1263
29  CoreFoundation                      0x000000011bb95e11 CFRunLoopRunSpecific + 625
30  GraphicsServices                    0x000000011fdf51dd GSEventRunModal + 62
31  UIKitCore                           0x0000000122f8d81d UIApplicationMain + 140
32  ???                                 0x0000000187cb6bce 0x0 + 6573222862
33  ???                                 0x0000000187cb6963 0x0 + 6573222243

我一直在四处寻找,找到了一些解决这个问题的潜在方案,但都没有奏效。我试过:

  • https://stackoverflow.com/a/8776005/2751571-在我的情况下,故事板被命名为"Main"。这在相关位置是一致的

  • https://stackoverflow.com/a/37502912/2751571-选中目标成员资格框。我试着取消检查,回到视觉工作室,重新检查。

  • https://stackoverflow.com/a/11547232/2751571-尝试了这些步骤,但没有成功。

  • https://stackoverflow.com/a/19240408/2751571-导致黑屏(尽管从info.plist删除行后没有崩溃)

请注意,对这些步骤中的每一个都进行了clean+重建。我还验证了Main.storyboard处于"复制捆绑资源"构建阶段,将我的存储库克隆到一个单独的目录中,完全重新安装了visual studio(以及下载的框架),以及我在搜索时遇到的许多其他东西。运气不好。

值得注意的是,默认的Xamarin.IOS项目确实在我的机器上运行,但并没有解释为什么这个项目只能在我的计算机上运行,而在其他计算机上运行。

嗨,你检查了info.plist 中添加的Main.storyboard吗

相关内容

最新更新