Bug 31395 - Crash when switching MainPage and using a Custom Render
Summary: Crash when switching MainPage and using a Custom Render
Alias: None
Product: Forms
Classification: Xamarin
Component: iOS ()
Version: 1.4.2
Hardware: PC Mac OS
: Normal normal
Target Milestone: ---
Assignee: Rui Marinho
Depends on:
Reported: 2015-06-26 05:34 UTC by Stefan Reinhard
Modified: 2015-07-15 11:22 UTC (History)
2 users (show)

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

Project reproducing the bug (190.31 KB, application/zip)
2015-06-26 05:34 UTC, Stefan Reinhard

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 Stefan Reinhard 2015-06-26 05:34:13 UTC
Created attachment 11746 [details]
Project reproducing the bug


A Xamarin.Forms App that uses a custom ViewRenderer (Didn't try any other Renderers) crashes under iOS with a NullReferenceException when the MainPage gets changed. Without the ViewRenderer everything works fine. Android is not affected.

Steps to Reproduce:

1) Write custom ViewRenderer
2) Use it somewhere in the App
3) Switch to a new App.MainPage

Actual Results:

App crashes with a NullReferenceException in External Code (probably Xamarin.Forms)

Excpected Result:

New MainPage should get visible

A sample Project reproducing the bug is attached.
Comment 1 Stefan Reinhard 2015-06-26 08:10:25 UTC
I currently use a workaround: Replacing ContentView with Frame and ViewRenderer with FrameRenderer solves the problem for me. 

However, Frame has a default padding, outline color and shadow that I don't need so I have to eliminate those.
Comment 2 Rui Marinho 2015-06-26 11:50:44 UTC
Will be fixed in 1.4.4-pre1
Comment 3 Parmendra Kumar 2015-07-15 11:22:47 UTC
I have checked this issue with Xamarin.Forms 1.4.4-pre1 and its working fine at my end.

Hence closing this issue.