Objective_C异常调试Xamarin C#iOS App时抛出

时间:2017-07-21 00:39:01

标签: c# ios xamarin xamarin.ios visual-studio-mac

当我去构建和调试我的iOS应用程序时,模拟器会运行但是我会抛出一个异常并且模拟器无法打开。我正在使用Visual Studio for Mac。

错误是:

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

2 个答案:

答案 0 :(得分:1)

似乎在您的项目中找不到main.storyboard。 请检查此pic

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

答案 1 :(得分:0)

好的,最怪异的事情就是解决它。我安装了从此页面获得的旧版Xarmarin iOS:https://bugzilla.xamarin.com/show_bug.cgi?id=38206

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