locked
Xamarin.iOS app crashes in simulator at startup since iOS 10 RRS feed

  • Question

  • User223730 posted

    As of the new Xamarin update, I am unable to successfully run my iOS app. It keeps crashing with a SIGABRT. If I start with the debugger, it throws an exception in the Main.cs file at UIApplication.Main(args, null, "AppDelegate"); with the following exception:

    ``` Unhandled Exception:

    System.ArgumentNullException: Value cannot be null.

    Parameter name: value


    [External Code] 
    0xB in UIKit.UIApplication.Main at /Users/builder/data/lanes/3818/ad1cd42d/source/xamarin-macios/src/UIKit/UIApplication.cs:79,-1
    0x3B in UIKit.UIApplication.Main at /Users/builder/data/lanes/3818/ad1cd42d/source/xamarin-macios/src/UIKit/UIApplication.cs:63,-1
    

    0x8 in MyAppNameHere.Application.Main at C:\Users__\git_____\Main.cs:12,13

    ```

    When I continue the code, the following native stack trace appears in the debug output:

    ``` Stacktrace:

    Native stacktrace: 0 MyAppNameHere 0x002c00bd monohandlenativesigsegv + 317 1 MyAppNameHere 0x002c9ec1 sigabrtsignalhandler + 161 2 libsystemplatform.dylib 0x0aa3979b sigtramp + 43 3 ??? 0xffffffff 0x0 + 4294967295 4 libsystemc.dylib 0x0a7c965d abort + 156 5 MyAppNameHere 0x00493f60 ZL20printallexceptionsP10MonoObject + 0 6 MyAppNameHere 0x002c09f0 monoinvokeunhandledexceptionhook + 96 7 MyAppNameHere 0x002bf79b monohandleexceptioninternal + 5611 8 MyAppNameHere 0x002be1a9 monohandleexception + 41 9 MyAppNameHere 0x00253b26 monox86throwexception + 182 10 ??? 0x16debb57 0x0 + 383695703 11 MyAppNameHere 0x0049a53c xamarininvoketrampoline + 8892 12 MyAppNameHere 0x004a320c xamarinarchtrampoline + 156 13 MyAppNameHere 0x004a38e6 xamarini386commontrampoline + 36 14 UIKit 0x00ee2b72 -[UIViewController sendViewDidLoadWithAppearanceProxyObjectTaggingEnabled] + 44 15 UIKit 0x00ee7692 -[UIViewController loadViewIfRequired] + 1384 16 UIKit 0x00f332bb -[UINavigationController _layoutViewController:] + 52 17 UIKit 0x00f33b75 -[UINavigationController _updateScrollViewFromViewController:toViewController:] + 421 18 UIKit 0x00f33d1c -[UINavigationController _startTransition:fromViewController:toViewController:] + 145 19 UIKit 0x00f35118 -[UINavigationController _startDeferredTransitionIfNeeded:] + 1038 20 UIKit 0x00f3639e -[UINavigationController viewWillLayoutSubviews] + 68 21 UIKit 0x0111b4b7 -[UILayoutContainerView layoutSubviews] + 252 22 UIKit 0x00de73d4 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 810 23 libobjc.A.dylib 0x09ce9059 -[NSObject performSelector:withObject:] + 70 24 QuartzCore 0x06ea9096 -[CALayer layoutSublayers] + 144 25 QuartzCore 0x06e9c8b6 _ZN2CA5Layer16layoutifneededEPNS11TransactionE + 388 26 QuartzCore 0x06e9c71a ZN2CA5Layer28layoutanddisplayifneededEPNS11TransactionE + 26 27 QuartzCore 0x06e8eee7 ZN2CA7Context18committransactionEPNS11TransactionE + 317 28 QuartzCore 0x06ec3847 _ZN2CA11Transaction6commitEv + 561 29 QuartzCore 0x06ec4108 _ZN2CA11Transaction17observercallbackEP19CFRunLoopObservermPv + 92 30 CoreFoundation 0x095a675e CFRUNLOOPISCALLINGOUTTOANOBSERVERCALLBACKFUNCTION + 30 31 CoreFoundation 0x095a66be CFRunLoopDoObservers + 398 32 CoreFoundation 0x0959b868 CFRunLoopRunSpecific + 504 33 CoreFoundation 0x0959b65b CFRunLoopRunInMode + 123 34 UIKit 0x00d112da -[UIApplication run] + 540 35 UIKit 0x00d16eb9 UIApplicationMain + 160 36 ??? 0x192e79dc 0x0 + 422476252 37 ??? 0x192e778c 0x0 + 422475660 38 ??? 0x192e5388 0x0 + 422466440 39 ??? 0x192e5000 0x0 + 422465536 40 ??? 0x192e5207 0x0 + 422466055 41 MyAppNameHere 0x002d1382 monojitruntimeinvoke + 1458 42 MyAppNameHere 0x0039b9bd doruntimeinvoke + 93 43 MyAppNameHere 0x0039e1bd monoruntimeexecmain + 1005 44 MyAppNameHere 0x0039dcfc monoruntimerunmain + 876 45 MyAppNameHere 0x0024a939 monojitexec + 265 46 MyAppNameHere 0x004a2649 xamarinmain + 3433 47 MyAppName_Here 0x00538891 main + 113 48 libdyld.dylib 0x0a722a25 start + 1

    ================================================================= Got a SIGABRT while executing native code. This usually indicates a fatal error in the mono runtime or one of the native libraries

    used by your application.

    ```

    This stacktrace personally does not inform me of where the problem could be. Is this a known/common issue?

    Thursday, October 6, 2016 9:47 AM

Answers

  • User223730 posted

    I've found out that the error in particular was fixed by cleaning my project and re-deploying. However, as @AxelCharpentier said, all my exceptions end up at said code, disallowing me from properly finding actual errors.

    If anyone is able to help me with that issue, I would appreciate it a lot.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Thursday, October 6, 2016 1:04 PM

All replies

  • User223730 posted

    I have tested this on the following devices/simulators

    • Iphone 5s - iOS 10.0 (Simulator)
    • Iphone 5s - iOS 9.3 (Simulator)
    • Iphone 5s - iOS 9.3 (Actual hardware) (WORKING)
    • Iphone 5s - iOS 8.1 (Simulator)

    I will be testing it on other devices in the simulator soon

    Thursday, October 6, 2016 9:51 AM
  • User58997 posted

    I have a similare problem in my Forms app, all exception thrown from iOS project are thrown (or debbuger fail to locate where it has been thrown) from UIApplication.Main(args, null, "AppDelegate"); with no stacktrace and debugge

    Thursday, October 6, 2016 12:58 PM
  • User223730 posted

    I've found out that the error in particular was fixed by cleaning my project and re-deploying. However, as @AxelCharpentier said, all my exceptions end up at said code, disallowing me from properly finding actual errors.

    If anyone is able to help me with that issue, I would appreciate it a lot.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Thursday, October 6, 2016 1:04 PM
  • User58997 posted

    https://bugzilla.xamarin.com/show_bug.cgi?id=45116

    Thursday, October 6, 2016 1:58 PM
  • User32675 posted

    Bummer, this makes it really hard to debug - is anyone doing anything about https://bugzilla.xamarin.com/show_bug.cgi?id=45116 ?

    Thursday, October 13, 2016 12:33 AM
  • User217174 posted

    Did anyone find a solution for all exceptions throwing from Main.cs? Had this issue for a while, having to add breakpoints all over my project to narrow down the bugs, it's very frustrating!

    Wednesday, January 11, 2017 6:08 PM
  • User223730 posted

    This is something that should be fixed. If you haven't updated xamarin in a while, I recommend doing so.

    There's certain workarounds for this specific issue, which can be found here, but I personally do not need them in my project anymore.

    If the project still crashes in Main.cs, it's usually from an error not related to the code directly. I recommend looking in the Output window (in visual studio, at least), where usually proper stack traces show up for that issue.

    Monday, January 16, 2017 4:15 PM