Bug 39335 - [FORMS 2.1.0.6524] Previously working layout broken after Forms upgrade on WinRT
Summary: [FORMS 2.1.0.6524] Previously working layout broken after Forms upgrade on WinRT
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 2.0.0
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-03-03 21:05 UTC by Jordan Roselle
Modified: 2016-03-09 17:22 UTC (History)
4 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 Jordan Roselle 2016-03-03 21:05:37 UTC
We have a complex layout which worked fine in the previous stable version of forms. Basically, we have a ContentPage which contains some global chrome, in that page we put ContentViews for various parts of the app, those ContentViews contain entire UIs, which can contain various controls we have built which are also ContentViews. The end result is we end up with some complex views, and after the upgrade to 2.1.0.6524 a lot of them don't work.

You can get a sample demonstrating the issue here: http://1drv.ms/1Y6SIr4

All the relevant code is in the shared App.cs. If you comment out line 66 it will work, put it back and it doesn't render.
Comment 1 Jordan Roselle 2016-03-07 14:57:46 UTC
This may be much simpler than I originally thought. It stills seems to happen if my layout is just the Grid containing a Scrollview containing a Label.
Comment 2 FieldstrikeMobile 2016-03-08 15:40:22 UTC
I am also seeing this error on iOS.

My Stacktrace is:

System.NullReferenceException: Object reference not set to an instance of an object

Thread finished: <Thread Pool> #8
The thread '<Thread Pool>' (0x8) has exited with code 0 (0x0).
2016-03-08 15:19:08.718 FieldStrikeMoveiOS[12958:7652422] Warning: Unhandled exception: System.NullReferenceException: Object reference not set to an instance of an object
  at Xamarin.Forms.Grid.LayoutChildren (Double x, Double y, Double width, Double height) [0x000a0] in <filename unknown>:0 
  at Xamarin.Forms.Layout.UpdateChildrenLayout () [0x000c7] in <filename unknown>:0 
  at Xamarin.Forms.Layout.OnSizeAllocated (Double width, Double height) [0x0000f] in <filename unknown>:0 
  at Xamarin.Forms.VisualElement.SizeAllocated (Double width, Double height) [0x00000] in <filename unknown>:0 
  at Xamarin.Forms.VisualElement.SetSize (Double width, Double height) [0x00021] in <filename unknown>:0 
  at Xamarin.Forms.VisualElement.set_Bounds (Rectangle value) [0x0006c] in <filename unknown>:0 
  at Xamarin.Forms.VisualElement.Layout (Rectangle bounds) [0x00000] in <filename unknown>:0 
  at Xamarin.Forms.Layout.LayoutChildIntoBoundingRegion (Xamarin.Forms.VisualElement child, Rectangle region) [0x00113] in <fil
ename unknown>:0 
  at Xamarin.Forms.Grid.LayoutChildren (Double x, Double y, Double width, Double height) [0x00158] in <filename unknown>:0 
  at Xamarin.Forms.Layout.UpdateChildrenLayout () [0x000c7] in <filename unknown>:0 
  at Xamarin.Forms.Layout.OnSizeAllocated (Double width, Double height) [0x0000f] in <filename unknown>:0 
  at Xamarin.Forms.VisualElement.SizeAllocated (Double width, Double height) [0x00000] in <filename unknown>:0 
  at Xamarin.Forms.Layout.ForceLayout () [0x0000d] in <filename unknown>:0 
  at Xamarin.Forms.Layout.InvalidateLayout () [0x00016] in <filename unknown>:0 
  at Xamarin.Forms.Layout.OnInternalAdded (Xamarin.Forms.View view) [0x00010] in <filename unknown>:0 
  at Xamarin.Forms.Layout.InternalChildrenOnCollectionChanged (System.Object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x00089] in <filename unknown>:0 
  at (wrapper delegate-invoke) <Module>:invoke_void_object_NotifyCollectionChangedEventArgs (object,System.Collections.Specialized.
NotifyCollectionChangedEventArgs)
  at System.Collections.ObjectModel.ObservableCollection`1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x00012] in /Users/builder/data/lanes/2966/58ba2bc3/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/external/referencesource/System/compmod/system/collections/objectmodel/observablecollection.cs:286 
  at System.Collections.ObjectModel.ObservableCollection`1[T].OnCollectionChanged (NotifyCollectionChangedAction action, System.Object item, Int32 index) [0x00000] in /Users/builder/data/lanes/2966/58ba2bc3/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/external/referencesource/System/compmod/system/collections/objectmodel/observablecollection.cs:349 
  at System.Collections.ObjectModel.ObservableCollection`1[T].InsertItem (Int32 index, System.Collections.ObjectModel.T item) [0x00024] in /Users/builder/data/lanes/2966/58ba2bc3/source/maccore/_build/Library/F
rameworks/Xamarin.iOS.framework/Versions/git/src/mono/external/referencesource/System/compmod/system/collections/objectmodel/observablecollection.cs:217 
  at System.Collections.ObjectModel.Collection`1[T].Add (System.Collections.ObjectModel.T item) [0x00023] in /Users/builder/data/lanes/2966/58ba2bc3/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/external/referencesource/mscorlib/system/collections/objectmodel/collection.cs:76 
  at Xamarin.Forms.ObservableWrapper`2[TTrack,TRestrict].Add (Xamarin.Forms.TRestrict item) [0x0004b] in <filename unknown>:0 
  at FieldStrikeMove.Forms.CustomControls.BaseContentPage.ChangeContent (Xamarin.Forms.View view, System.Object vm) [0x00012] in D:\tfs\FieldStrike\FieldStrikeMove\FieldStrikeMove.Forms\CustomControls\Pages\BaseContentPage.cs:316 
  at FieldStrikeMove.Forms.CustomControls.NavigationHubPage.Change (System.Type pageType, Boolean movingBack, System.Object[] args) [0x00156] in D:\tfs\FieldStrike\FieldStrikeMove\FieldStrikeMove
.Forms\CustomControls\Pages\NavigationHubPage.cs:350 
  at FieldStrikeMove.Forms.CustomControls.NavigationHubPage.ChangePageCallback () [0x00001] in D:\tfs\FieldStrike\FieldStrikeMove\FieldStrikeMove.Forms\CustomControls\Pages\NavigationHubPage.cs:281 
  at FieldStrikeMove.Forms.CustomControls.SideTray+<HidePanel>d__10.MoveNext () [0x00143] in D:\tfs\FieldStrike\FieldStrikeMove\FieldStrikeMove.Forms\CustomControls\Misc\SideTray.cs:153 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Users/builder/data/lanes/2966/58ba2bc3/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/external/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:143 
  at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<ThrowAsync>m__0 (System.Object state) [0x00000] in /Users/builder/data/lanes/2966/58ba2bc3/source/maccore/_build/Library/Frameworks/Xamarin.
iOS.framework/Versions/git/src/mono/external/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs:994 
  at UIKit.UIKitSynchronizationContext+<Post>c__AnonStorey0.<>m__0 () [0x00000] in /Users/builder/data/lanes/2966/58ba2bc3/source/maccore/src/UIKit/UIKitSynchronizationContext.cs:24 
  at Foundation.NSAsyncActionDispatcher.Apply () [0x00000] in /Users/builder/data/lanes/2966/58ba2bc3/source/maccore/src/Foundation/NSAction.cs:163 
  at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
  at UIKit.UIApplication.Main (System.String[] args, IntPtr principal, IntPtr delegate) [0x00005] in /Users/builder/data/lanes/2966/58ba2bc3/source/maccore/src/UIKit/UIApplication.cs:77 
  at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00038] in /Users/builder/data/lanes/2966/58ba2bc3/source/maccore/src/UIKit/UIApplication.cs:61
Comment 3 Jordan Roselle 2016-03-09 16:12:47 UTC
Fixed in latest Forms release.
Comment 4 FieldstrikeMobile 2016-03-09 17:22:46 UTC
Latest update also fixes iOS. Thank god. Christ knows how I would have found the root of this to report or produce a repo