[Bug] ListView crash in preview 5 on Android and Windows
See original GitHub issueDescription
The following ListView in MAUI preview 5 crashes on Android and WinUI (but it works on iOS):
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:MauiApp3"
x:Class="MauiApp3.MainPage">
<StackLayout Margin="20">
<ListView>
<ListView.ItemsSource>
<x:Array Type="{x:Type local:Person}">
<local:Person Name="Dave" Age="21" />
<local:Person Name="Ed" Age="50" />
</x:Array>
</ListView.ItemsSource>
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Grid ColumnDefinitions="Auto,Auto">
<Label Text="{Binding Name}"
TextColor="Black" />
<Label Grid.Column="1"
Text="{Binding Age}"
TextColor="Black"
HorizontalTextAlignment="End" />
</Grid>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackLayout>
</ContentPage>
Steps to Reproduce
- Run the attached sample on Android or WinUI.
Expected Behavior
A ListView displays two rows of data.
Actual Behavior
Android: ListView displays for ~2s before the app terminates. Windows: UnhandledException (object not set to an instance of an object).
Basic Information
- Version with issue: 6.0.100-preview.5.794
- Last known good version: N/A
- IDE: VS2019 16.11 P2
- Platform Target Frameworks:
- Android: API 30
- Win: net6.0-windows10.0.19041
Reproduction Link
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
ListView ItemsSource refreshing problems in Windows and ...
On Android having 1 object shown then adding another and showing both will crash the app, same if you first show 5 and...
Read more >updated visual studio xamarin to 16.9.1 and now my ...
updated visual studio xamarin to 16.9.1 and now my ListView continuously updates its self till it crashes the app.
Read more >Nexus 5 with latest android 5 preview- App crashing during ...
Issue 431280: Nexus 5 with latest android 5 preview- App crashing during webview reload · 1. Take Android Cordova application · 2. In...
Read more >Large set of data in listview crashing the android app
Hi I need to manage the large set of data in Listview in android app. The list items may be around 250 or...
Read more >Hot Reload freezes VS Mac with virtualized ListViews
The issue is this: if you have Hot Reload with Changes Only mode and a virtualized ListView in the screen (XF 5+), thousands...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I also am seeing this on Windows but with MAUI Preview 4.634.
Closing this for now. I wasn’t able to reproduce with the attached project on P14