xamarin / Xamarin.Forms

Xamarin.Forms is no longer supported. Migrate your apps to .NET MAUI.
https://aka.ms/xamarin-upgrade
Other
5.62k stars 1.87k forks source link

[Bug] Java.Lang.NullPointerException when trying to preview CarouselPage #9695

Open ArcanoxDragon opened 4 years ago

ArcanoxDragon commented 4 years ago

Description

If I change a page in my application to inherit from Xamarin.Forms.CarouselPage, the Xamarin.Forms Previewer crashes when attempting to preview it with a Java.Lang.NullPointerException. There does not appear to be any way to copy the stack trace text from a Xamarin.Forms previewer crash (which is another major issue in and of itself), so I've included the best I can do with screenshots below. Note that this happens even with CarouselPage.Children provided in XAML and with pages included in it; I've omitted that specific markup for brevity as the crash happens regardless.

Steps to Reproduce

  1. Add a page and have it inherit from CarouselPage.
  2. Open the XAML Previewer
  3. The previewer will crash after a few seconds and say "An exception occurred while rendering the control."

Expected Behavior

The page will preview normally

Actual Behavior

The previewer crashes and does not render any sort of preview.

Basic Information

Screenshots

Exception thrown: image

Previewer and source code after crash: image

Reproduction Link

https://gist.github.com/briman0094/30ceca84bce276174e09a27efba640e0

Workaround

It seemed like for a while that removing all bin/obj folders and rebuilding would allow the view to render once, but it doesn't seem like this reliably allows it to render.

jsuarezruiz commented 4 years ago

I can reproduce the issue using Xamarin.Forms 4.4 and Visual Studio for macOS.

Attached repro sample.

Issue9695.zip