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

Xamarin Forms on Android: ScrollView on ListView header crashes app when closing page #1931

@Mirksar

Description

@Mirksar

Bug report best practices: https://github.com/xamarin/Xamarin.Forms/wiki/Submitting-Issues

Description

In a page with this structure:

    <ListView>
        <ListView.Header>
            <ScrollView Orientation="Horizontal">
                <StackLayout Orientation="Horizontal">
                    <BoxView Color="Green ">
                    </BoxView>
                </StackLayout>
            </ScrollView>
        </ListView.Header>
    </ListView>

The app crashes when pressing back on the device with this stack trace:

ScrollViewRenderer.Dispose (System.Boolean disposing)
D:\agent_work\1\s\Xamarin.Forms.Platform.Android\Renderers\ScrollViewRenderer.cs - line 180
System.NullReferenceException: Object reference not set to an instance of an object.
Object reference not set to an instance of an object.
ScrollViewRenderer.Dispose (System.Boolean disposing) D:\agent_work\1\s\Xamarin.Forms.Platform.Android\Renderers\ScrollViewRenderer.cs:180
Object.Dispose () /Users/builder/data/lanes/5809/413eed68/source/monodroid/external/xamarin-android/src/Mono.Android/Java.Lang/Object.cs:203
ListViewRenderer.Dispose (System.Boolean disposing) D:\agent_work\1\s\Xamarin.Forms.Platform.Android\Renderers\ListViewRenderer.cs:60
Object.Dispose () /Users/builder/data/lanes/5809/413eed68/source/monodroid/external/xamarin-android/src/Mono.Android/Java.Lang/Object.cs:203
VisualElementRenderer`1[TElement].Dispose (System.Boolean disposing) D:\agent_work\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:234
Object.Dispose () /Users/builder/data/lanes/5809/413eed68/source/monodroid/external/xamarin-android/src/Mono.Android/Java.Lang/Object.cs:203

Steps to Reproduce

Please, find atached a project that reproduces the crash. Execute the project and just press back on Android

Expected Behavior

Going back from the app doesn't crash the app

Actual Behavior

When pressing back on the navigation the app crashes

Basic Information

  • Version with issue:
  • Last known good version:
  • IDE:
  • Platform Target Frameworks:
    • Android: 8.0

Reproduction Link

https://www.dropbox.com/s/di52t93ag4kewxe/ScrollCrashTest.7z?dl=0

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions