Hello everyone, i found something strange in my application, in 1/30 (ios) and 1/1000 (android) i got strange exception in this 2 lines :
StackLayoutName.Children.Insert(StackLayoutName.Children.IndexOf(elementToRemove), temp);
StackLayoutName.Children.Remove(elementToRemove);
I checked everything, no nulls in variables, no index out of range, no any mistake that i can't found, but i get exception.
Can anyone help me with it?
Сообщение: Object reference not set to an instance of an object
Тип: System.NullReferenceException
at Xamarin.Forms.BindableObject.GetContext (Xamarin.Forms.BindableProperty property) [0x00013] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Core\BindableObject.cs:489
at Xamarin.Forms.BindableObject.GetValue (Xamarin.Forms.BindableProperty property) [0x0000e] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Core\BindableObject.cs:54
at Xamarin.Forms.Layout.get_Padding () [0x00000] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Core\Layout.cs:84
at Xamarin.Forms.Layout.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00027] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Core\Layout.cs:111
at Xamarin.Forms.VisualElement.Measure (System.Double widthConstraint, System.Double heightConstraint, Xamarin.Forms.MeasureFlags flags) [0x00054] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Core\VisualElement.cs:527
at Xamarin.Forms.StackLayout.CalculateNaiveLayout (Xamarin.Forms.StackLayout+LayoutInformation layout, Xamarin.Forms.StackOrientation orientation, System.Double x, System.Double y, System.Double widthConstraint, System.Double heightConstraint) [0x00236] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Core\StackLayout.cs:185
at Xamarin.Forms.StackLayout.CalculateLayout (Xamarin.Forms.StackLayout+LayoutInformation layout, System.Double x, System.Double y, System.Double widthConstraint, System.Double heightConstraint, System.Boolean processExpanders) [0x00058] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Core\StackLayout.cs:110
at Xamarin.Forms.StackLayout.OnSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00019] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Core\StackLayout.cs:67
at Xamarin.Forms.VisualElement.OnMeasure (System.Double widthConstraint, System.Double heightConstraint) [0x00000] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Core\VisualElement.cs:593
at Xamarin.Forms.VisualElement.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00053] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Core\VisualElement.cs:469
at Xamarin.Forms.Layout.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00000] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Core\Layout.cs:110
at Xamarin.Forms.VisualElement.Measure (System.Double widthConstraint, System.Double heightConstraint, Xamarin.Forms.MeasureFlags flags) [0x00054] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Core\VisualElement.cs:527
at Xamarin.Forms.StackLayout.CalculateNaiveLayout (Xamarin.Forms.StackLayout+LayoutInformation layout, Xamarin.Forms.StackOrientation orientation, System.Double x, System.Double y, System.Double widthConstraint, System.Double heightConstraint) [0x000a8] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Core\StackLayout.cs:150
at Xamarin.Forms.StackLayout.CalculateLayout (Xamarin.Forms.StackLayout+LayoutInformation layout, System.Double x, System.Double y, System.Double widthConstraint, System.Double heightConstraint, System.Boolean processExpanders) [0x00058] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Core\StackLayout.cs:110
at Xamarin.Forms.StackLayout.OnSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00019] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Core\StackLayout.cs:67
at Xamarin.Forms.VisualElement.OnMeasure (System.Double widthConstraint, System.Double heightConstraint) [0x00000] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Core\VisualElement.cs:593
at Xamarin.Forms.VisualElement.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00053] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Core\VisualElement.cs:469
at Xamarin.Forms.Layout.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00000] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Core\Layout.cs:110
at Xamarin.Forms.VisualElement.Measure (System.Double widthConstraint, System.Double heightConstraint, Xamarin.Forms.MeasureFlags flags) [0x00054] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Core\VisualElement.cs:527
at Xamarin.Forms.StackLayout.CalculateNaiveLayout (Xamarin.Forms.StackLayout+LayoutInformation layout, Xamarin.Forms.StackOrientation orientation, System.Double x, System.Double y, System.Double widthConstraint, System.Double heightConstraint) [0x000a8] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Core\StackLayout.cs:150
at Xamarin.Forms.StackLayout.CalculateLayout (Xamarin.Forms.StackLayout+LayoutInformation layout, System.Double x, System.Double y, System.Double widthConstraint, System.Double heightConstraint, System.Boolean processExpanders) [0x00058] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Core\StackLayout.cs:110
at Xamarin.Forms.StackLayout.LayoutChildren (System.Double x, System.Double y, System.Double width, System.Double height) [0x0005b] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Core\StackLayout.cs:44
at Xamarin.Forms.Layout.UpdateChildrenLayout () [0x000c7] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Core\Layout.cs:229
at Xamarin.Forms.Layout.OnSizeAllocated (System.Double width, System.Double height) [0x0000f] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Core\Layout.cs:194
at Xamarin.Forms.VisualElement.SizeAllocated (System.Double width, System.Double height) [0x00000] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Core\VisualElement.cs:629
at Xamarin.Forms.Layout.ForceLayout () [0x00000] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Core\Layout.cs:104
at Xamarin.Forms.Layout.InvalidateLayout () [0x00016] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Core\Layout.cs:174
at Xamarin.Forms.Layout.OnInternalAdded (Xamarin.Forms.View view) [0x0002d] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Core\Layout.cs:404
at Xamarin.Forms.Layout.InternalChildrenOnCollectionChanged (System.Object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x00089] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Core\Layout.cs:392
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/3818/ad1cd42d/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/referencesource/System/compmod/system/collections/objectmodel/observablecollection.cs:288
at System.Collections.ObjectModel.ObservableCollection
1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedAction action, System.Object item, System.Int32 index) [0x00000] in /Users/builder/data/lanes/3818/ad1cd42d/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/referencesource/System/compmod/system/collections/objectmodel/observablecollection.cs:351
at System.Collections.ObjectModel.ObservableCollection
1[T].InsertItem (System.Int32 index, T item) [0x00024] in /Users/builder/data/lanes/3818/ad1cd42d/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/referencesource/System/compmod/system/collections/objectmodel/observablecollection.cs:219
at System.Collections.ObjectModel.Collection
1[T].Insert (System.Int32 index, T item) [0x00038] in /Users/builder/data/lanes/3818/ad1cd42d/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/referencesource/mscorlib/system/collections/objectmodel/collection.cs:103
at Xamarin.Forms.ObservableWrapper
2[TTrack,TRestrict].Insert (System.Int32 index, TRestrict item) [0x00032] in C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Core\ObservableWrapper.cs:117
at Application.UI.Menu.TestPage+d__11.MoveNext () [0x00640] in C:\Projects\Application.UI.Menu.TestPage.cs:303
`