Hi all,
I'm currently pulling my hair out over an error occurring in my Xamarin.Forms App. When I leave the app (hit the home button), and re-enter I am getting a "System.NullReferenceException: Object reference not set to an instance of an object" error. I'm tracing it through the OnResume function in app.xaml.cs where I'm opening a new navigation page (the exact same thing happens OnStart). It then opens the new page and seems to get stuck after the "InitializeComponent" function where the "System.NullReferenceException" is thrown.
It only seems to be happening when I test it on my Android device running Android 5.1, it won't happen in my iOS simulator running iOS 9.3 or my other Android device running Android 6.0.1. I have all the correct Android SDKs installed and up to date and it otherwise runs without error on Android 5.1.
I'm using Xamarin.Forms 2.3.1.114.
Let me know if you need any further information and sorry in advance, I'm new to Xamarin.
Any ideas are appreciated, thanks in advance!
In my App.xaml.cs:
`
protected override void OnStart()
{
base.OnResume();
MainPage = new NavigationPage(new MyProject.Views.MyPage());
}
protected override void OnResume()
{
base.OnResume();
MainPage = new NavigationPage(new MyProject.Views.MyPage());
}
`