Bug 44846 - UNHANDLED EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object at Xamarin.Forms.Platform.Android.ListViewAdapter constructor when you call Platform.SetRenderer(view, Platform.CreateRenderer(view));
Summary: UNHANDLED EXCEPTION: System.NullReferenceException: Object reference not set ...
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 2.3.2
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: E.Z. Hart [MSFT]
Depends on:
Reported: 2016-09-28 20:23 UTC by Alex Rainman
Modified: 2017-06-19 22:33 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 Alex Rainman 2016-09-28 20:23:29 UTC
I am trying to use Platform.SetRenderer(view, Platform.CreateRenderer(view)), where view is a Xamarin.Forms.View that contains a ListView. I get System.NullReferenceException: Object reference not set to an instance of an object at ListViewAdapter constructor. I cannot find a way to fix this. It works OK in the previous version of Forms.
Comment 1 E.Z. Hart [MSFT] 2016-10-03 22:06:58 UTC
Thank you for taking the time to submit the bug. We tried to reproduce the issue you reported but were unable given the description. If you could please attach a reproduction to the bug by starting with a clean Xamarin.Forms project and adding just the code necessary to demonstrate the issue, we would very much appreciate it.

For your convenience, we have created some reproduction best practices viewable here: https://gist.github.com/jassmith/92405c300e54a01dcc6d

Warm regards,

Xamarin Forms Team
Comment 2 Alex Rainman 2016-10-19 19:49:07 UTC
You can use my CarouselView plugin repo to reproduce the bug. Update to latest xamarin.forms and include a ListView one of the views (MyFirstView.xaml). Run the demo.

Comment 3 Rui Marinho 2017-06-19 22:33:00 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.

Here are some reproduction best practices: https://gist.github.com/jassmith/92405c300e54a01dcc6d