Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

NullReferenceException Xamarin.Forms.Platform.iOS.StructuredItemsViewRenderer [Bug] #8715

Closed
brcinho opened this issue Nov 29, 2019 · 14 comments · Fixed by #9675
Closed

NullReferenceException Xamarin.Forms.Platform.iOS.StructuredItemsViewRenderer [Bug] #8715

brcinho opened this issue Nov 29, 2019 · 14 comments · Fixed by #9675
Assignees
Labels
a/collectionview a/shell 🐚 blocker Issue blocks next stable release. Prioritize fixing and reviewing this issue. e/3 🕒 3 i/high Completely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less often in-progress This issue has an associated pull request that may resolve it! p/iOS 🍎 t/bug 🐛

Comments

@brcinho
Copy link

brcinho commented Nov 29, 2019

Xamarin Forms 4.4.0.991210-pre2
IPhone 7, iOS v13.1.3

NullReferenceException

at Xamarin.Forms.Platform.iOS.StructuredItemsViewRenderer

have a lot of IsVisible Bindings and other bindings in my XAML
in XAML you can mainly find two CollectionViews, StackLayout, FlexButtons
It is reproducible when one of the CollectionViews visibility changes from hidden to IsVisible and back to hidden, and then in my shell navigating to an entry in another FlyoutItem and then back to original FlyoutItem entry. So keep in mind only when switching from menu entries in different FlyoutItems
Strangely if I just switch from menu entries in the same FlyoutItem the exception doesn't occur.

Unfortunately can not provide an example code in quick notice.
Full stack trace:

at Xamarin.Forms.Platform.iOS.StructuredItemsViewRenderer2[TItemsView,TViewController].LayoutSubviews () [0x0000c] in <4f759157e6f148a992d3fa3b90518ad0>:0 at (wrapper managed-to-native) ObjCRuntime.Messaging.void_objc_msgSend(intptr,intptr) at CoreAnimation.CALayer.LayoutSublayers () [0x00008] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.6.0.12/src/Xamarin.iOS/CALayer.g.cs:508 at Xamarin.Forms.Platform.iOS.VisualElementTracker+<>c__DisplayClass29_0.g__update|0 () [0x00162] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementTracker.cs:252 at Xamarin.Forms.Platform.iOS.VisualElementTracker.OnUpdateNativeControl (CoreAnimation.CALayer caLayer) [0x002be] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementTracker.cs:324 at Xamarin.Forms.Platform.iOS.VisualElementTracker.UpdateNativeControl () [0x00060] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementTracker.cs:376 at Xamarin.Forms.Platform.iOS.VisualElementTracker.SetElement (Xamarin.Forms.VisualElement oldElement, Xamarin.Forms.VisualElement newElement) [0x00055] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementTracker.cs:352 at Xamarin.Forms.Platform.iOS.VisualElementTracker..ctor (Xamarin.Forms.Platform.iOS.IVisualElementRenderer renderer, System.Boolean trackFrame) [0x0006b] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementTracker.cs:50 at Xamarin.Forms.Platform.iOS.VisualElementTracker..ctor (Xamarin.Forms.Platform.iOS.IVisualElementRenderer renderer) [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementTracker.cs:36 at Xamarin.Forms.Platform.iOS.VisualElementRenderer1[TElement].SetElement (TElement element) [0x0009f] in <4f759157e6f148a992d3fa3b90518ad0>:0
at Xamarin.Forms.Platform.iOS.VisualElementRenderer1[TElement].Xamarin.Forms.Platform.iOS.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00000] in <4f759157e6f148a992d3fa3b90518ad0>:0 at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x00014] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Platform.cs:188 at Xamarin.Forms.Platform.iOS.VisualElementPackager.OnChildAdded (Xamarin.Forms.VisualElement view) [0x0003e] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:99 at Xamarin.Forms.Platform.iOS.VisualElementPackager.Load () [0x0001e] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:48 at Xamarin.Forms.Platform.iOS.VisualElementRenderer1[TElement].SetElement (TElement element) [0x000de] in <4f759157e6f148a992d3fa3b90518ad0>:0
at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.iOS.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00000] in <4f759157e6f148a992d3fa3b90518ad0>:0
at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x00014] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Platform.cs:188
at Xamarin.Forms.Platform.iOS.VisualElementPackager.OnChildAdded (Xamarin.Forms.VisualElement view) [0x0003e] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:99
at Xamarin.Forms.Platform.iOS.VisualElementPackager.Load () [0x0001e] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:48
at Xamarin.Forms.Platform.iOS.PageRenderer.ViewDidLoad () [0x0008f] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\PageRenderer.cs:238
at (wrapper managed-to-native) ObjCRuntime.Messaging.IntPtr_objc_msgSendSuper(intptr,intptr)
at UIKit.UIViewController.get_View () [0x0002a] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.6.0.12/src/Xamarin.iOS/UIViewController.g.cs:3171
at Xamarin.Forms.Platform.iOS.PageRenderer.get_NativeView () [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\PageRenderer.cs:104
at Xamarin.Forms.Platform.iOS.PageRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x0003d] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\PageRenderer.cs:120
at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x00014] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Platform.cs:188
at Xamarin.Forms.Platform.iOS.ShellSectionRootRenderer.LoadRenderers () [0x00028] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\ShellSectionRootRenderer.cs:146
at Xamarin.Forms.Platform.iOS.ShellSectionRootRenderer.ViewDidLoad () [0x00035] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\ShellSectionRootRenderer.cs:63
at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)

@brcinho brcinho added s/unverified New report that has yet to be verified t/bug 🐛 labels Nov 29, 2019
@pauldipietro pauldipietro added this to New in Triage Nov 29, 2019
@brcinho
Copy link
Author

brcinho commented Nov 29, 2019

Reminds on this issue 5161

@brcinho
Copy link
Author

brcinho commented Nov 29, 2019

Unfortunately we need to have multiple FlyoutItems in AppShell because we use it only for navigation drawer (hamburger), no bottom tabs, and when we have more then 5 menu items in a FlyoutItem, the styling of the appbar/toolbar is broken for the pages 6+ on iOS

@brcinho
Copy link
Author

brcinho commented Nov 29, 2019

How collection view item template looks like:

         xmlns:ff="clr-namespace:FFImageLoading.Forms;assembly=FFImageLoading.Forms"
         xmlns:material="clr-namespace:XF.Material.Forms.UI;assembly=XF.Material"

<CollectionView.ItemTemplate>

                <DataTemplate x:DataType="mvvmData:SelectableItemVM">
                    <ContentView>
                        <material:MaterialCard IsClippedToBounds="True" CornerRadius="2" Elevation="2" Padding="5"
                                VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand" IsClickable="True"
                                ClickCommand="{Binding ToggleSelected}" Style="{DynamicResource Key=SelectableCardView}">

                            <Grid >
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto" />
                                </Grid.RowDefinitions>

                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="*" />
                                </Grid.ColumnDefinitions>

                                <ff:CachedImage 
                                    VerticalOptions="Center"
                                    HeightRequest="140"
                                    WidthRequest="140"
                                    Aspect="AspectFit"
                                    BackgroundColor="WhiteSmoke"
                                    Source="{Binding ItemDetails.CalculatedImageUri}"/>

                                <StackLayout Grid.Column="1" Padding="5,15">
                                <Label 
                                   Text="{Binding ItemDetails.Name}"
                                   FontAttributes="Bold"
                                    Style="{DynamicResource Key=SelectableCardViewLabel}"/>

                                <Label Text="{Binding ItemDetails.ItemClassName}"
                                    Style="{DynamicResource Key=SelectableCardViewLabel}"/>

                                <Label Text="{Binding ItemDetails.ModelName}"
                                    Style="{DynamicResource Key=SelectableCardViewLabel}"/>

                                <Label Text="{Binding ItemDetails.ManufacturerName}"
                                    Style="{DynamicResource Key=SelectableCardViewLabel}"/>

                                <Label Text="{Binding ItemDetails.SerialNumber}"
                                    Style="{DynamicResource Key=SelectableCardViewLabel}"/>

                                <Label Text="{Binding ItemDetails.Description}"
                                    Style="{DynamicResource Key=SelectableCardViewLabel}"/>
                                </StackLayout>
                            </Grid>
                        </material:MaterialCard>
                    </ContentView>
                </DataTemplate>

            </CollectionView.ItemTemplate>
        </CollectionView>

@jfversluis
Copy link
Member

Unfortunately can not provide an example code in quick notice.

While I understand you might not have the time, I hope you understand that this will probably also mean that we won't be able to solve this any time soon. Having a reproduction will greatly help us identify and solve the problem.

@jfversluis jfversluis added a/shell 🐚 p/iOS 🍎 s/needs-repro ❔ This reported issue doesn't include a sample project reproducing the issue. Please provide one. labels Nov 29, 2019
@samhouts samhouts moved this from New to Needs Info in Triage Dec 2, 2019
@brcinho
Copy link
Author

brcinho commented Dec 3, 2019

TestDemoCrash.zip

demo xamarin forms project

@brcinho
Copy link
Author

brcinho commented Dec 3, 2019

iPhone 11 Pro Max iOS 13.2 2019-12-03 10-12-16.mp4.zip

Video of reproduction steps

  • the trick is to toggle the visibility of collection view from IsVisible="False" to "True" and back to "False"
  • then if you navigate back and forth between the pages of the same FlyoutItem and return to the page where you have collection view, everything is ok
  • if you navigate to page in another FlyoutItem and return back to this page the crash happens

@brcinho
Copy link
Author

brcinho commented Dec 3, 2019

I checked now and it seems that ListView doesn't have this problem, only CollectionView

@brcinho
Copy link
Author

brcinho commented Dec 3, 2019

@jfversluis How soon can it be solved and released? So we know whether to revert to alternatives. We have a deployment rather soon.

@jfversluis
Copy link
Member

jfversluis commented Dec 3, 2019

Originates from this line:

Where Controller is null at the time of the crash.

Steps:

  • go to "Flyout 2, page 1" (second option) in the flyout menu, toggle the CollectionView
  • toggle CollectionView to be visible and then invisible. Make sure it's invisible when you leave the page
  • go to "Flyout 1, page 1" (first option) in the flyout menu
  • go to "Flyout 2, page 1" (second option) in the flyout menu, observe the crash

Just iOS, Android is all fine and still happening in latest nightly.
Full stack trace

at Xamarin.Forms.Platform.iOS.StructuredItemsViewRenderer2[TItemsView,TViewController].LayoutSubviews () [0x00006] in D:\a\1\s\Xamarin.Forms.Platform.iOS\CollectionView\StructuredItemsViewRenderer.cs:77 at (wrapper managed-to-native) ObjCRuntime.Messaging.void_objc_msgSend(intptr,intptr) at CoreAnimation.CALayer.LayoutSublayers () [0x00008] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.8.2.2/src/Xamarin.iOS/CALayer.g.cs:508 at Xamarin.Forms.Platform.iOS.VisualElementTracker+<>c__DisplayClass29_0.<OnUpdateNativeControl>g__update|0 () [0x00162] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementTracker.cs:252 at Xamarin.Forms.Platform.iOS.VisualElementTracker.OnUpdateNativeControl (CoreAnimation.CALayer caLayer) [0x002be] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementTracker.cs:324 at Xamarin.Forms.Platform.iOS.VisualElementTracker.UpdateNativeControl () [0x00060] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementTracker.cs:376 at Xamarin.Forms.Platform.iOS.VisualElementTracker.SetElement (Xamarin.Forms.VisualElement oldElement, Xamarin.Forms.VisualElement newElement) [0x00055] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementTracker.cs:352 at Xamarin.Forms.Platform.iOS.VisualElementTracker..ctor (Xamarin.Forms.Platform.iOS.IVisualElementRenderer renderer, System.Boolean trackFrame) [0x0006b] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementTracker.cs:50 at Xamarin.Forms.Platform.iOS.VisualElementTracker..ctor (Xamarin.Forms.Platform.iOS.IVisualElementRenderer renderer) [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementTracker.cs:36 at Xamarin.Forms.Platform.iOS.VisualElementRenderer1[TElement].SetElement (TElement element) [0x0009f] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementRenderer.cs:257
at Xamarin.Forms.Platform.iOS.VisualElementRenderer1[TElement].Xamarin.Forms.Platform.iOS.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementRenderer.cs:144 at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x00014] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Platform.cs:188 at Xamarin.Forms.Platform.iOS.VisualElementPackager.OnChildAdded (Xamarin.Forms.VisualElement view) [0x0003e] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:99 at Xamarin.Forms.Platform.iOS.VisualElementPackager.Load () [0x0001e] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:48 at Xamarin.Forms.Platform.iOS.VisualElementRenderer1[TElement].SetElement (TElement element) [0x000de] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementRenderer.cs:264
at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.iOS.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementRenderer.cs:144
at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x00014] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Platform.cs:188
at Xamarin.Forms.Platform.iOS.VisualElementPackager.OnChildAdded (Xamarin.Forms.VisualElement view) [0x0003e] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:99
at Xamarin.Forms.Platform.iOS.VisualElementPackager.Load () [0x0001e] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:48
at Xamarin.Forms.Platform.iOS.PageRenderer.ViewDidLoad () [0x0008f] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\PageRenderer.cs:238
at (wrapper managed-to-native) ObjCRuntime.Messaging.IntPtr_objc_msgSendSuper(intptr,intptr)
at UIKit.UIViewController.get_View () [0x0002a] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.8.2.2/src/Xamarin.iOS/UIViewController.g.cs:3171
at Xamarin.Forms.Platform.iOS.PageRenderer.get_NativeView () [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\PageRenderer.cs:104
at Xamarin.Forms.Platform.iOS.PageRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x0003d] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\PageRenderer.cs:120
at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x00014] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Platform.cs:188
at Xamarin.Forms.Platform.iOS.ShellSectionRootRenderer.LoadRenderers () [0x00028] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\ShellSectionRootRenderer.cs:146
at Xamarin.Forms.Platform.iOS.ShellSectionRootRenderer.ViewDidLoad () [0x00035] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\ShellSectionRootRenderer.cs:63
at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.8.2.2/src/Xamarin.iOS/UIKit/UIApplication.cs:86
at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0000e] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.8.2.2/src/Xamarin.iOS/UIKit/UIApplication.cs:65
at TestDemoCrash.iOS.Application.Main (System.String[] args) [0x00001] in /Users/jfversluis/Downloads/TestDemoCrash/TestDemoCrash/TestDemoCrash.iOS/Main.cs:17

@jfversluis jfversluis added a/collectionview blocker Issue blocks next stable release. Prioritize fixing and reviewing this issue. e/3 🕒 3 and removed s/needs-repro ❔ This reported issue doesn't include a sample project reproducing the issue. Please provide one. s/unverified New report that has yet to be verified labels Dec 3, 2019
@jfversluis jfversluis moved this from Needs Info to Ready For Work in Triage Dec 3, 2019
@jfversluis jfversluis added this to To do in v4.4.0 via automation Dec 3, 2019
@jfversluis jfversluis added this to the 4.4.0 milestone Dec 3, 2019
@samhouts samhouts added this to To do in iOS Ready For Work Dec 6, 2019
@samhouts samhouts removed this from Ready For Work in Triage Dec 6, 2019
@JohnLivermore
Copy link

I am having this same issue!

@codeanees
Copy link

Same issue. I am trying to use the Collection View inside ContentView. Works fine in Android. In iOS it is throwing NullReferenceException. Here's the ST:

" at Xamarin.Forms.Platform.iOS.StructuredItemsViewRenderer2[TItemsView,TViewController].LayoutSubviews () [0x00006] in D:\\a\\1\\s\\Xamarin.Forms.Platform.iOS\\CollectionView\\StructuredItemsViewRenderer.cs:81 \n at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)\n at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.6.0.12/src/Xamarin.iOS/UIKit/UIApplication.cs:86 \n at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0000e] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.6.0.12/src/Xamarin.iOS/UIKit/UIApplication.cs:65 \n at ProjectName.iOS.Application.Main (System.String[] args) [0x00001] in /........./Main.cs:12 " "

@samhouts samhouts added this to To do in Sprint 164 Jan 3, 2020
@samhouts samhouts added this to Backlog in CollectionView Jan 3, 2020
@samhouts samhouts added this to To do in Sprint 165 Jan 18, 2020
@samhouts samhouts moved this from To do to Continued in next sprint in Sprint 164 Jan 18, 2020
@samhouts samhouts added the i/high Completely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less often label Feb 7, 2020
@samhouts samhouts removed this from the 4.4.0 milestone Feb 7, 2020
@samhouts samhouts moved this from To do to Returned to backlog in Sprint 165 Feb 7, 2020
@samhouts samhouts added this to To do in Sprint 166 Feb 11, 2020
@Wbenay
Copy link

Wbenay commented Feb 13, 2020

Same issue here! Android is working, but IOS No.

XAML
<Shell.Items>

    //Here the tabs are inserted at run time
    <FlyoutItem x:Name="FlyoutItemMain" FlyoutDisplayOptions="AsMultipleItems" />
    <FlyoutItem x:Name="FlyoutItemReport" FlyoutDisplayOptions="AsMultipleItems"      Shell.TabBarIsVisible="False" />

    <FlyoutItem FlyoutDisplayOptions="AsMultipleItems" Shell.TabBarIsVisible="False" >
        <Tab Title="Profile">
            <Tab.Icon>
                <FontImageSource FontFamily="{StaticResource SegMDL2}" Glyph="&#xE77B;" Color="#343434" />
            </Tab.Icon>
            <ShellContent  ContentTemplate="{DataTemplate views:PersonPage}" />
        </Tab>

        <Tab Title="About">
            <Tab.Icon>
                <FontImageSource FontFamily="{StaticResource SegMDL2}" Glyph="&#xE946;" Color="#343434" />
            </Tab.Icon>
            <ShellContent  ContentTemplate="{DataTemplate views:AboutPage}" />
        </Tab>
    </FlyoutItem>
</Shell.Items>

C#

var font = Device.RuntimePlatform == Device.Android ? "SegMDL2.ttf#Segoe MDL2 Assets" : "Segoe MDL2 Assets";

FlyoutItemMain.Items.Add(new ShellContent
{
Title = "Ponto",
Route = "Registrar",
Content = new HomePage(),
Icon = new FontImageSource { FontFamily = font, Glyph = "\uED5A", Color = Color.FromHex("#343434") }
});

FlyoutItemReport.Items.Add(new ShellContent
{
Title = "Marcação 24Hs",
Content = new Relatorios24hsPage(),
Icon = new FontImageSource { FontFamily = font, Glyph = "\uE9F9", Color = Color.FromHex("#343434") }
});

@hartez hartez self-assigned this Feb 13, 2020
@Wbenay
Copy link

Wbenay commented Feb 13, 2020

The problem is in any page shell that I call MainPage. If I call a ContentPage it works!
Today I updated the Mono version!

=== Visual Studio Professional 2019 for Mac ===

Version 8.4.5 (build 19)
Installation UUID: c1337f6b-7a99-4d59-bc1a-23e08278a6a1
GTK+ 2.24.23 (Raleigh theme)
Xamarin.Mac 5.16.1.25 (issue-7441-d16-3-vsmac / 881172e73)

Package version: 606000155

=== Mono Framework MDK ===

Runtime:
Mono 6.6.0.155 (2019-08/296a9afdb24) (64-bit)
Package version: 606000155

=== Roslyn (Language Service) ===

3.4.0-beta4-19562-05+ff930dec4565e2bc424ad3bf3e22ecb20542c87d

=== NuGet ===

Version: 5.3.0.6192

=== .NET Core SDK ===

SDK: /usr/local/share/dotnet/sdk/3.1.101/Sdks
SDK Versions:
3.1.101
3.0.101
3.0.100
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/6.6.0/lib/mono/msbuild/Current/bin/Sdks

=== .NET Core Runtime ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
3.1.1
3.0.1
3.0.0
2.1.15
2.1.14
2.1.13

=== Xamarin.Profiler ===

Version: 1.6.12.29
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Updater ===

Version: 11

=== Apple Developer Tools ===

Xcode 11.3.1 (15715)
Build 11C504

=== Xamarin.Mac ===

Version: 6.10.0.17 (Visual Studio Professional)
Hash: 5f802ef53
Branch: xcode11.3
Build date: 2020-01-07 11:53:06-0500

=== Xamarin.iOS ===

Version: 13.10.0.17 (Visual Studio Professional)
Hash: 5f802ef53
Branch: xcode11.3
Build date: 2020-01-07 11:53:06-0500

=== Xamarin Designer ===

Version: 16.4.0.479
Hash: 074544417
Branch: remotes/origin/d16-4
Build date: 2020-01-22 22:50:22 UTC

=== Xamarin.Android ===

Version: 10.1.3.7 (Visual Studio Professional)
Commit: xamarin-android/d16-4/d66aed0
Android SDK: /Users/devprime/Library/Developer/Xamarin/android-sdk-macosx
Supported Android versions:
None installed

SDK Tools Version: 26.1.1
SDK Platform Tools Version: 28.0.2
SDK Build Tools Version: 28.0.3

Build Information:
Mono: fd9f379
Java.Interop: xamarin/java.interop@c4e569f
ProGuard: xamarin/proguard@905836d
SQLite: xamarin/sqlite@46204c4
Xamarin.Android Tools: xamarin/xamarin-android-tools@9f4ed4b

=== Microsoft Mobile OpenJDK ===

Java SDK: /Users/devprime/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_1.8.0.25
1.8.0-25
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Android SDK Manager ===

Version: 16.4.0.10
Hash: 2c49a7d
Branch: remotes/origin/d16-4
Build date: 2020-01-30 10:22:44 UTC

=== Android Device Manager ===

Version: 16.4.0.30
Hash: f9172e2
Branch: remotes/origin/d16-4
Build date: 2020-01-30 10:23:04 UTC

=== Xamarin Inspector ===

Version: 1.4.3
Hash: db27525
Branch: 1.4-release
Build date: Mon, 09 Jul 2018 21:20:18 GMT
Client compatibility: 1

=== Build Information ===

Release ID: 804050019
Git revision: 5b9e12b8142016693a4b0f0bdac84ffac1d84c28
Build date: 2020-02-07 12:51:25+00
Build branch: release-8.4
Xamarin extensions: 5b9e12b8142016693a4b0f0bdac84ffac1d84c28

=== Operating System ===

Mac OS X 10.15.2
Darwin 19.2.0 Darwin Kernel Version 19.2.0
Sat Nov 9 03:47:04 PST 2019
root:xnu-6153.61.1~20/RELEASE_X86_64 x86_64

@JohnLivermore
Copy link

This happened for me when transitioning from one page containing a collection view to a different page. Before the 2nd page is requested, I need to hide the collection view (IsVisible=false) to prevent a weird flash I was seeing. However, the collection view remained hidden after transitioning to the 2nd page, and when I went back to the 1st page (that has the collection view), I get the error. I was able to fix this by sending a message from page 2 to page 1 telling page 1 to 'show' the collection view (IsVisible=true). Once I had that in place, the error went away.

For my case, if the collection view is hidden prior to navigating away, when you go back to that page, the error is immediately thrown. Doesn't matter if you try to show the collection view in page 1's OnAppearing method.

Hopefully this helps someone else?

@samhouts samhouts added the in-progress This issue has an associated pull request that may resolve it! label Feb 21, 2020
@samhouts samhouts added this to In Progress in v4.6.0 Feb 21, 2020
@samhouts samhouts moved this from To do to Ready for Review (Issues) in Sprint 166 Feb 21, 2020
@hartez hartez moved this from To do (blockers) to In Progress in CollectionView Feb 21, 2020
iOS Ready For Work automation moved this from To do to Done Feb 26, 2020
CollectionView automation moved this from In Progress to Done Feb 26, 2020
v4.4.0 automation moved this from To do to Done Feb 26, 2020
jfversluis added a commit that referenced this issue Feb 26, 2020
…ments (#9675)

* Add missing null check before asking the Controller to update measurements.
Fixes #8715

* Fix XAML compilation build error

Co-authored-by: Gerald Versluis <github@geraldversluis.nl>
Shell automation moved this from To do (blockers) to Done Feb 26, 2020
v4.6.0 automation moved this from In Progress to Done Feb 26, 2020
Sprint 166 automation moved this from Ready for Review (Issues) to Done Feb 26, 2020
@samhouts samhouts added this to In Progress in vCurrent (4.8.0) Feb 27, 2020
@samhouts samhouts moved this from In Progress to Done in vCurrent (4.8.0) Feb 28, 2020
@samhouts samhouts removed this from Done in vCurrent (4.8.0) Mar 2, 2020
@samhouts samhouts removed this from Done in iOS Ready For Work May 6, 2020
@samhouts samhouts removed this from Done in CollectionView May 6, 2020
@samhouts samhouts removed this from Done in Shell May 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a/collectionview a/shell 🐚 blocker Issue blocks next stable release. Prioritize fixing and reviewing this issue. e/3 🕒 3 i/high Completely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less often in-progress This issue has an associated pull request that may resolve it! p/iOS 🍎 t/bug 🐛
Projects
No open projects
Sprint 164
  
Continued in next sprint
Sprint 165
  
Returned to backlog
Sprint 166
  
Done
v4.4.0
  
Done
v4.6.0
  
Done
Development

Successfully merging a pull request may close this issue.

7 participants