Bug 35442 - Keeps throwing an exception System.NullReferenceException: Object reference not set to an instance of an object
Summary: Keeps throwing an exception System.NullReferenceException: Object reference n...
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.5.0
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2015-11-01 03:51 UTC by mgwalm
Modified: 2016-04-13 19:23 UTC (History)
6 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description mgwalm 2015-11-01 03:51:31 UTC
If I have a splash page where I don't want an Action bar, I put the following in the cstor of the page:

    public SplashView()
      BindingContext = new SplashViewModel();

      NavigationPage.SetHasNavigationBar(this, false);

ie, I don't want an Action bar.

howevere the Xamarin.Forms.Platform.Android.Platform stills tries to display and update the Action bar.

As shown by the following stack trace.

11-01 18:33:29.951 I/MonoDroid(31803): System.NullReferenceException: Object reference not set to an instance of an object
11-01 18:33:29.951 I/MonoDroid(31803): at Xamarin.Forms.Platform.Android.Platform.UpdateActionBarHomeAsUp (Android.App.ActionBar) <IL 0x0001f, 0x00138>
11-01 18:33:29.951 I/MonoDroid(31803): at Xamarin.Forms.Platform.Android.Platform.HideActionBar () <IL 0x0000d, 0x00093>
11-01 18:33:29.951 I/MonoDroid(31803): at Xamarin.Forms.Platform.Android.Platform.UpdateActionBar () <IL 0x000a1, 0x004b3>
11-01 18:33:29.951 I/MonoDroid(31803): at Xamarin.Forms.Platform.Android.Platform.SetPage (Xamarin.Forms.Page) <IL 0x000be, 0x0065b>
11-01 18:33:29.951 I/MonoDroid(31803): at Xamarin.Forms.Platform.Android.FormsApplicationActivity.InternalSetPage (Xamarin.Forms.Page) <IL 0x000be, 0x00507>
11-01 18:33:29.951 I/MonoDroid(31803): at Xamarin.Forms.Platform.Android.FormsApplicationActivity.SetMainPage () <IL 0x0000c, 0x00077>
11-01 18:33:29.951 I/MonoDroid(31803): at Xamarin.Forms.Platform.Android.FormsApplicationActivity.LoadApplication (Xamarin.Forms.Application) <IL 0x0002e, 0x0019b>
11-01 18:33:29.951 I/MonoDroid(31803): at TFH.XApp.Android.MainActivity.OnCreate (Android.OS.Bundle) [0x00042] in E:\MSIV2012\TFH\UI\V2\TFH.UI\Xamarin.App\Xamarin.App.Android\MainActivity.cs:104
11-01 18:33:29.951 I/MonoDroid(31803): at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (intptr,intptr,intptr) [0x00011] in /Users/builder/data/lanes/2185/53fce373/source/monodroid/src/Mono.Android/platforms/android-22/src/generated/Android.App.Activity.cs:2741
11-01 18:33:29.951 I/MonoDroid(31803): at (wrapper dynamic-method) object.65381983-5336-4c4b-9f95-afd7c6836796 (intptr,intptr,intptr) <IL 0x00017, 0x00043>
Comment 1 Rajneesh Kumar 2016-01-14 14:01:19 UTC
I have tried to reproduce this issue but unable to reproduce it. 

Could you provide a sample, steps, ide log and environment info, so we can reproduce this issue at our end.

You can get Ide log via Help -> Xamarin -> Zip Logs and Environment info via Help -> About Microsoft Visual Studio

Environment info: https://gist.github.com/NaqeebAnsari/fa599d873175013c5fa2
Comment 2 mgwalm 2016-03-24 23:50:21 UTC
Ive tried it in the latest release and the problem has gone away.
Comment 3 Rui Marinho 2016-04-13 19:23:27 UTC
Thank you for taking the time to submit this report. After reviewing the description of this bug, we believe it no longer affects the current version of Xamarin.Forms. If you are still experiencing the issue after updating your packages, please reopen this report with an attached reproduction.
For your convenience, we have created some reproduction best practices viewable here: https://gist.github.com/jassmith/92405c300e54a01dcc6d

Warm regards,
Xamarin Forms Team