Bug 21051 - TableView in StackLayout causes crash in 1.1.X
Summary: TableView in StackLayout causes crash in 1.1.X
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.1.1
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-07-02 12:17 UTC by Jon Douglas [MSFT]
Modified: 2015-02-05 07:27 UTC (History)
6 users (show)

Tags:
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:
Status:
RESOLVED FIXED

Description Jon Douglas [MSFT] 2014-07-02 12:17:00 UTC
When upgrading from Xamarin.Forms 1.0.X to 1.1.X, there seems to be an issue with having a TableView inside a StackLayout which works fine in the 1.0.X version.

Attached is a simple project reproducing the error. 

Below is a stack trace:

System.Diagnostics.Debugger.Mono_UnhandledException_internal () in
System.Diagnostics.Debugger.Mono_UnhandledException
(ex={System.NullReferenceException: Object reference not set to an instance
of an object
at Xamarin.Forms.Platform.Android.VisualElementTracker.UpdateNativeView
(object,System.EventArgs) <IL 0x00006, 0x00058>
at (wrapper delegate-invoke) <Module>.invoke_void__this___object_EventArgs
(object,System.EventArgs) <IL 0x00027, 0x00067>
at (wrapper delegate-invoke) <Module>.invoke_void__this___object_EventArgs
(object,System.EventArgs) <IL 0x00027, 0x00067>
at Xamarin.Forms.VisualElement.SetSize (double,double) <IL 0x0003d, 0x001cb>
at Xamarin.Forms.VisualElement.set_Bounds (Xamarin.Forms.Rectangle) <IL
0x0006c, 0x00347>
at Xamarin.Forms.VisualElement.Layout (Xamarin.Forms.Rectangle) <IL
0x00002, 0x000cb>
at Xamarin.Forms.Layout.LayoutChildIntoBoundingRegion
(Xamarin.Forms.VisualElement,Xamarin.Forms.Rectangle) <IL 0x00118, 0x008db>
at Xamarin.Forms.StackLayout.LayoutChildren (double,double,double,double)
<IL 0x001b6, 0x0102f>
at Xamarin.Forms.Layout.UpdateChildrenLayout () <IL 0x000c1, 0x0064f>
at Xamarin.Forms.Layout.OnSizeAllocated (double,double) <IL 0x00010,
0x000ab>
at Xamarin.Forms.VisualElement.SizeAllocated (double,double) <IL 0x00003,
0x00083>
at Xamarin.Forms.VisualElement.SetSize (double,double) <IL 0x00024, 0x00173>
at Xamarin.Forms.VisualElement.set_Bounds (Xamarin.Forms.Rectangle) <IL
0x0006c, 0x00347>
at Xamarin.Forms.VisualElement.Layout (Xamarin.Forms.Rectangle) <IL
0x00002, 0x000cb>
at
Xamarin.Forms.Platform.Android.ViewCellRenderer/ViewCellContainer.OnLayout
(bool,int,int,int,int) <IL 0x00046, 0x00273>
at Android.Views.ViewGroup.n_OnLayout_ZIIII
(intptr,intptr,bool,int,int,int,int) [0x00009] in
/Users/builder/data/lanes/monodroid-mlion-monodroid-4.12-series/41933531/source/monodroid/src/Mono.Android/platforms/android-15/src/generated/Android.Views.ViewGroup.cs:2869
at (wrapper dynamic-method) object.db017f71-0220-4e3e-8308-469ee16e8efb
(intptr,intptr,bool,int,int,int,int) <IL 0x0002f, 0x00093>
}) in
object.db017f71-0220-4e3e-8308-469ee16e8efb (arg0=0x41821f38,
arg1=0xffffffffba200029, arg2=true, arg3=0, arg4=82, arg5=768, arg6=170) in
Xamarin.Forms.Platform.Android.VisualElementTracker.UpdateNativeView
(sender={Xamarin.Forms.Label}, e={System.EventArgs}) in
Xamarin.Forms.VisualElement.SetSize (width=384, height=19) in
Xamarin.Forms.VisualElement.set_Bounds (value=X=0, Y=0, Width=384,
Height=19) in
Xamarin.Forms.VisualElement.Layout (bounds=X=0, Y=0, Width=384, Height=19)
in
Xamarin.Forms.Layout.LayoutChildIntoBoundingRegion
(child={Xamarin.Forms.Label}, region=X=0, Y=0, Width=384, Height=19) in
Xamarin.Forms.StackLayout.LayoutChildren (x=, y=, width=, height=) in
Xamarin.Forms.Layout.UpdateChildrenLayout (Parameters=) in
Xamarin.Forms.Layout.OnSizeAllocated (Parameters=) in
Xamarin.Forms.VisualElement.SizeAllocated (Parameters=) in
Xamarin.Forms.VisualElement.SetSize (Parameters=) in
Xamarin.Forms.VisualElement.set_Bounds (Parameters=) in
Xamarin.Forms.VisualElement.Layout (Parameters=) in
Xamarin.Forms.Platform.Android.ViewCellRenderer.ViewCellContainer.OnLayout
(Parameters=) in
Android.Views.ViewGroup.n_OnLayout_ZIIII (Parameters=) in
/Users/builder/data/lanes/monodroid-mlion-monodroid-4.12-series/41933531/source/monodroid/src/Mono.Android/platforms/android-15/src/generated/Android.Views.ViewGroup.cs:2869
object.db017f71-0220-4e3e-8308-469ee16e8efb (Parameters=) in
Android.Runtime.JNIEnv.CallVoidMethod (Parameters=) in
/Users/builder/data/lanes/monodroid-mlion-monodroid-4.12-series/41933531/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:503
Android.Views.ViewGroup.Layout (Parameters=) in
/Users/builder/data/lanes/monodroid-mlion-monodroid-4.12-series/41933531/source/monodroid/src/Mono.Android/platforms/android-15/src/generated/Android.Views.ViewGroup.cs:2674
Xamarin.Forms.Platform.Android.ViewRenderer<Xamarin.Forms.TableView,Android.Widget.ListView>.OnLayout
(Parameters=) in
Xamarin.Forms.Platform.Android.TableViewRenderer.OnLayout (Parameters=) in
Android.Views.ViewGroup.n_OnLayout_ZIIII (Parameters=) in
/Users/builder/data/lanes/monodroid-mlion-monodroid-4.12-series/41933531/source/monodroid/src/Mono.Android/platforms/android-15/src/generated/Android.Views.ViewGroup.cs:2869
object.db017f71-0220-4e3e-8308-469ee16e8efb (Parameters=) in
Android.Runtime.JNIEnv.CallVoidMethod (Parameters=) in
/Users/builder/data/lanes/monodroid-mlion-monodroid-4.12-series/41933531/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:503
Android.Views.ViewGroup.Layout (Parameters=) in
/Users/builder/data/lanes/monodroid-mlion-monodroid-4.12-series/41933531/source/monodroid/src/Mono.Android/platforms/android-15/src/generated/Android.Views.ViewGroup.cs:2674
Xamarin.Forms.Platform.Android.VisualElementTracker.UpdateLayout
(Parameters=) in
Xamarin.Forms.Platform.Android.VisualElementRenderer<Xamarin.Forms.TableView>.UpdateLayout
(Parameters=) in
Xamarin.Forms.Platform.Android.VisualElementRenderer<Xamarin.Forms.View>.OnLayout
(Parameters=) in
Android.Views.ViewGroup.n_OnLayout_ZIIII (Parameters=) in
/Users/builder/data/lanes/monodroid-mlion-monodroid-4.12-series/41933531/source/monodroid/src/Mono.Android/platforms/android-15/src/generated/Android.Views.ViewGroup.cs:2869
object.db017f71-0220-4e3e-8308-469ee16e8efb (Parameters=) in
Android.Runtime.JNIEnv.CallVoidMethod (Parameters=) in
/Users/builder/data/lanes/monodroid-mlion-monodroid-4.12-series/41933531/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:503
Android.Views.ViewGroup.Layout (Parameters=) in
/Users/builder/data/lanes/monodroid-mlion-monodroid-4.12-series/41933531/source/monodroid/src/Mono.Android/platforms/android-15/src/generated/Android.Views.ViewGroup.cs:2674
Xamarin.Forms.Platform.Android.VisualElementTracker.UpdateLayout
(Parameters=) in
Xamarin.Forms.Platform.Android.VisualElementRenderer<Xamarin.Forms.View>.UpdateLayout
(Parameters=) in
Xamarin.Forms.Platform.Android.VisualElementRenderer<Xamarin.Forms.Page>.OnLayout
(Parameters=) in
Android.Views.ViewGroup.n_OnLayout_ZIIII (Parameters=) in
/Users/builder/data/lanes/monodroid-mlion-monodroid-4.12-series/41933531/source/monodroid/src/Mono.Android/platforms/android-15/src/generated/Android.Views.ViewGroup.cs:2869
object.db017f71-0220-4e3e-8308-469ee16e8efb (Parameters=) in
Android.Runtime.JNIEnv.CallVoidMethod (Parameters=) in
/Users/builder/data/lanes/monodroid-mlion-monodroid-4.12-series/41933531/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:503
Android.Views.ViewGroup.Layout (Parameters=) in
/Users/builder/data/lanes/monodroid-mlion-monodroid-4.12-series/41933531/source/monodroid/src/Mono.Android/platforms/android-15/src/generated/Android.Views.ViewGroup.cs:2674
Xamarin.Forms.Platform.Android.VisualElementTracker.UpdateLayout
(Parameters=) in
Xamarin.Forms.Platform.Android.VisualElementRenderer<Xamarin.Forms.Page>.UpdateLayout
(Parameters=) in
Xamarin.Forms.Platform.Android.Platform.OnLayout (Parameters=) in
Xamarin.Forms.Platform.Android.PlatformRenderer.OnLayout (Parameters=) in
Android.Views.ViewGroup.n_OnLayout_ZIIII (Parameters=) in
/Users/builder/data/lanes/monodroid-mlion-monodroid-4.12-series/41933531/source/monodroid/src/Mono.Android/platforms/android-15/src/generated/Android.Views.ViewGroup.cs:2869
object.db017f71-0220-4e3e-8308-469ee16e8efb (Parameters=) in
Comment 2 Jason Smith [MSFT] 2014-07-15 07:07:20 UTC
Can you re-confirm this bug on 1.2.1? I can't seem to reproduce it with the provided app.
Comment 3 Rodja Trappe 2014-07-18 00:27:14 UTC
I tried updating Xamarin.Forms and reproducing the bug. But I'm getting a black screen and the app hangs up with the message "... isn't responding. Do you want to close it?".
But even worse: When searching for minimum example I end up with the default "Blank App (Xamarin.Forms Shared)" solution containing nothing but a "Hello, Forms!" label. After updating the packages for this solution I get the very same black screen!

Thus, I've no clue how to use this new version for any of our projects!
Or maybe there's an undocumented trick how to get this version running. I don't know.
Comment 4 Rui Marinho 2015-02-05 07:27:27 UTC
This is fixed in 1.3.2.