Hi all,
I'm new to Xamarin, and I think the Xamarin.Forms idea is amazing. I'm really enjoying working in this framework.
I have a question, though. My android code keeps throwing this error in the stacktrace that's pointing back to an object reference error. It is a reference to the apparent singleton of Xamarin.Forms.NavigationProxy, which seems to be null when it is calling the set_Inner function. I'm still getting familiar with the system.
This happens after the app starts up, intermittently when it's idle at times, sometimes after I click on a button. But it nearly always happens in the app right now.
I can post code here as well, but I thought I would post a high level of what I'm seeing first to see if others have seen the same issue.
I'm using the current release (July 30th 1.2.2).
Here's the exact stack trace, the error happens in the MainActivity.cs class calling OnCreate.
07-31 00:55:22.755 I/MonoDroid(27186): UNHANDLED EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object
07-31 00:55:22.755 I/MonoDroid(27186): at Xamarin.Forms.NavigationProxy.set_Inner (Xamarin.Forms.INavigation)
07-31 00:55:22.755 I/MonoDroid(27186): at Xamarin.Forms.Platform.Android.Platform.SetPage (Xamarin.Forms.Page)
07-31 00:55:22.755 I/MonoDroid(27186): at Xamarin.Forms.Platform.Android.AndroidActivity.SetPage (Xamarin.Forms.Page)
07-31 00:55:22.755 I/MonoDroid(27186): at Catalyst.Conference.Core.Droid.MainActivity.OnCreate (Android.OS.Bundle) [0x0002a] in c:\supersecretpath/Android\MainActivity.cs:26
07-31 00:55:22.755 I/MonoDroid(27186): at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (intptr,intptr,intptr) [0x00011] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.12-series/163212a9/source/monodroid/src/Mono.Android/platforms/android-19/src/generated/Android.App.Activity.cs:2178
07-31 00:55:22.755 I/MonoDroid(27186): at (wrapper dynamic-method) object.e3e6dfc0-7a0f-4a3a-a846-5024f02c8bcc (intptr,intptr,intptr)
Unhandled Exception:
System.NullReferenceException: Object reference not set to an instance of an object
07-31 00:55:24.367 E/mono (27186):
07-31 00:55:24.367 E/mono (27186): Unhandled Exception:
07-31 00:55:24.367 E/mono (27186): System.NullReferenceException: Object reference not set to an instance of an object
07-31 00:55:24.367 E/mono (27186): at Xamarin.Forms.NavigationProxy.set_Inner (INavigation value) [0x00000] in :0
07-31 00:55:24.367 E/mono (27186): at Xamarin.Forms.Platform.Android.Platform.SetPage (Xamarin.Forms.Page newRoot) [0x00000] in :0
07-31 00:55:24.367 E/mono (27186): at Xamarin.Forms.Platform.Android.AndroidActivity.SetPage (Xamarin.Forms.Page page) [0x00000] in :0
07-31 00:55:24.367 E/mono (27186): at Catalyst.Conference.Core.Droid.MainActivity.OnCreate (Android.OS.Bundle bundle) [0x0002a] in c:\supersecretpath/Android\MainActivity.cs:26
07-31 00:55:24.367 E/mono (27186): at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (IntPtr jnienv, IntPtr native__this, IntPtr native_savedInstanceState) [0x00011] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.12-series/163212a9/source/monodroid/src/Mono.Android/platforms/android-19/src/generated/Android.App.Activity.cs:2178
07-31 00:55:24.367 E/mono (27186): at (wrapper dynamic-method) obje
07-31 00:55:24.367 E/mono-rt (27186): [ERROR] FATAL UNHANDLED EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object
07-31 00:55:24.367 E/mono-rt (27186): at Xamarin.Forms.NavigationProxy.set_Inner (INavigation value) [0x00000] in :0
07-31 00:55:24.367 E/mono-rt (27186): at Xamarin.Forms.Platform.Android.Platform.SetPage (Xamarin.Forms.Page newRoot) [0x00000] in :0
07-31 00:55:24.367 E/mono-rt (27186): at Xamarin.Forms.Platform.Android.AndroidActivity.SetPage (Xamarin.Forms.Page page) [0x00000] in :0
07-31 00:55:24.367 E/mono-rt (27186): at Catalyst.Conference.Core.Droid.MainActivity.OnCreate (Android.OS.Bundle bundle) [0x0002a] in c:\mysupersecretpathtothesolution/Android\MainActivity.cs:26
07-31 00:55:24.367 E/mono-rt (27186): at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (IntPtr jnienv, IntPtr native__this, IntPtr native_savedInstanceState) [0x00011] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.12-series/163212a9/source/monodroid/src/Mono.Android/platforms/android-19/src/generated/Android.App.Activity.cs:2178
07-31 00:55:24.367 E/mono-rt (27186): at (wrapper dynamic
The program 'Mono' has exited with code 0 (0x0).
I don't see others having this problem, so it must be something I'm doing.
Right now, my setup is pretty simple. My main view is one of the content pages, and I push another content page as a modal shortly after the app starts up. The error usually happens within a minute or so of running the app.
I'll post some code samples too, if that's needed. The thing I can't explain is why the object reference error is happening on the Xamarin.Forms.NavigationProxy object. I don't have an explanation why, in my code, it's causing it to be null after a few minutes. This appears to be working correctly on the iOS side, though.
Any help is appreciated. Thank you!
-Mike