Objective-C异常在调试Xamarin C#iOS App时发生异常

问题描述:

当我开始构建和调试我的iOS应用程序时,模拟器运行但我得到一个异常并且模拟器无法打开。我正在使用Visual Studio for Mac。Objective-C异常在调试Xamarin C#iOS App时发生异常

的错误是:

Objective-C exception thrown.Name: NSInvalidArgumentException Reason: 
Could not find a storyboard named 'Main' in bundle NSBundle 
</Users/(Username 
here)/Library/Developer/CoreSimulator/Devices/23E98CA3-FC40-4AA4-8AAD- 
62A9FADE1118/data/Containers/Bundle/Application/715B09C7-FBF2-41E6- 
8FCD-A6329DE9E758/(AppName Here).app> (loaded) 
Native stack trace: 
    0 CoreFoundation      0x0000000108f31b0b 
__exceptionPreprocess + 171 
    1 libobjc.A.dylib      0x0000000113b0e141 
objc_exception_throw + 48 
    2 UIKit        0x000000010d005cfb + 
[UIStoryboard storyboardWithName:bundle:] + 663 
    3 UIKit        0x000000010c84590d - 
[UIApplication _loadMainStoryboardFileNamed:bundle:] + 72 
    4 UIKit        0x000000010c845e13 - 
[UIApplication _loadMainInterfaceFile] + 260 
    5 UIKit        0x000000010c8444b6 - 
[UIApplication _runWithMainScene:transitionContext:completion:] + 1407 
    6 UIKit        0x000000010c8417f3 - 
[UIApplication workspaceDidEndTransaction:] + 182 
    7 FrontBoardServices     0x00000001168265f6 
__FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 24 
    8 FrontBoardServices     0x000000011682646d - 
[FBSSerialQueue _performNext] + 186 
    9 FrontBoardServices     0x00000001168267f6 - 
[FBSSerialQueue _performNextFromRunLoopSource] + 45 
    10 CoreFoundation      0x0000000108ed7c01 
__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17 
    11 CoreFoundation      0x0000000108ebd0cf 
__CFRunLoopDoSources0 + 527 
    12 CoreFoundation      0x0000000108ebc5ff 
__CFRunLoopRun + 911 
    13 CoreFoundation      0x0000000108ebc016 
CFRunLoopRunSpecific + 406 
    14 UIKit        0x000000010c84008f - 
[UIApplication _run] + 468 
    15 UIKit        0x000000010c846134 
UIApplicationMain + 159 
    16 ???         0x000000012bee336c 0x0 + 
5031998316 
    17 ???         0x0000000128fc6abd 0x0 + 
4982598333 

感谢, ž

编辑:

添加图片。

Info.plist

好吧,最奇怪的事固定它。我安装了从本页获得的Xarmarin iOS的旧版本:https://bugzilla.xamarin.com/show_bug.cgi?id=38206

然后当我打开Visual Studio时,它没有检测到它并让我更新它。更新它后,我的应用程序能够调试和模拟器工作正常!非常非常奇怪!

好像没有main.storyboard可以在你的项目中找到。 检查这个pic

如果主界面是Main,检查main.storyboard是否在您的项目中存在。 或者您可以将其更改为其他viewController。

+0

嗨,感谢您的信息。我检查过,Main是我的主界面,我的项目中有一个main.storyboard,这就是为什么它很奇怪。我将编辑我的帖子以包含图片。谢谢! –

+0

尝试新建故事板并将其设置为主界面以查看问题是否仍然存在 –

+0

我添加了新的故事板并将其设置为main,现在我得到相同的错误,但它列出了新板的名称。 :/ –