Xamarin App crashes on Reopen NullReference

1.3k views Asked by At

I have an app on Xamarin, it works fine, if I press back button, to move to main menu it hides in app stack, so when I open it back from app stack it suddenly crashes with NullReference

06-10 15:59:57.363 I/MonoDroid(14891): UNHANDLED EXCEPTION:
06-10 15:59:57.363 I/MonoDroid(14891): System.NullReferenceException: Object reference not set to an instance of an object
06-10 15:59:57.363 I/MonoDroid(14891): at Xamarin.Forms.Platform.Android.FormsApplicationActivity.OnPrepareOptionsMenu (Android.Views.IMenu) <IL 0x00007, 0x00050>
06-10 15:59:57.363 I/MonoDroid(14891): at Android.App.Activity.n_OnPrepareOptionsMenu_Landroid_view_Menu_ (intptr,intptr,intptr) [0x00011] in /Users/builder/data/lanes/monodroid-mavericks-monodroid-5.1-series/d419c934/source/monodroid/src/Mono.Android/platforms/android-21/src/generated/Android.App.Activity.cs:4151
06-10 15:59:57.363 I/MonoDroid(14891): at (wrapper dynamic-method) object.87f976f0-8c0f-4463-92f4-c8ed92b6336d (intptr,intptr,intptr) <IL 0x00017, 0x0004b>
06-10 15:59:57.383 D/AndroidRuntime(14891): Shutting down VM
06-10 15:59:57.383 W/dalvikvm(14891): threadid=1: thread exiting with uncaught exception (group=0x41b66c08)
An unhandled exception occured.

Any ideas will be helpful, stuck with it for too long

my main activity code: http://pastebin.com/d9G77MJg

1

There are 1 answers

1
JamesMontemagno On BEST ANSWER

We figured out this issue. The problem was with a 3rd party library that isn't officially supported (XLabs). They have their own dependency service and Greag was re-registering things causing an exception that was being gobbled up so the LoadApplication would never be loaded.