Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App crash in Release Mode when binding ItemSource in CollectionView #24416

Closed
GhostDestroyex opened this issue Aug 24, 2024 · 3 comments
Closed
Labels
area-controls-collectionview CollectionView, CarouselView, IndicatorView platform/android 🤖 potential-regression This issue described a possible regression on a currently supported version., verification pending t/bug Something isn't working

Comments

@GhostDestroyex
Copy link

Description

Hello Maui team,
Hello, I am using visual studio 2022 and I have a movie application project that has a search engine and when something is typed it makes a call to an API to return the search results, which I assign to the ItemSource property of the CollectionView.
When I do that process in Release mode the application crashes.
The property that I bind is an ObservableCollection, I have also tried using a ListView but the same thing happens to me.

This is my workload list:
image

Steps to Reproduce

Create a File > New .Net MAUI App
Add a CollectionView
Set the ItemsSource property of the CollectionView binding in Xaml
Set release mode

Link to public reproduction project repository

https://github.com/GhostDestroyex/MoviesShowApp

Version with bug

Unknown/Other

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android 13

Did you find any workaround?

No response

Relevant log output

No response

@GhostDestroyex GhostDestroyex added the t/bug Something isn't working label Aug 24, 2024
Copy link
Contributor

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@samhouts samhouts added platform/android 🤖 potential-regression This issue described a possible regression on a currently supported version., verification pending labels Aug 24, 2024
@Serebie
Copy link

Serebie commented Aug 25, 2024

I tested your project and it works fine for me after changing 2 small things.

In your .csproj I changed the package references for Microsoft.Maui.Controls and Microsoft.Maui.Controls.Compatibility from this

<PackageReference Update="Microsoft.Maui.Controls" Version="8.0.60" />
<PackageReference Update="Microsoft.Maui.Controls.Compatibility" Version="8.0.60" /> 

to this

<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.60" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.60" /> 

And in your Home.xaml file there is a the style SelectedResultStyle which is accidentally using x:Name instead of x:Key.

After changing these 2 things, I could run your app in release mode.

@GhostDestroyex
Copy link
Author

I've tested the solution and it already works correctly, thank you very much, I am closing the issue. Thanks @Serebie

@samhouts samhouts added the area-controls-collectionview CollectionView, CarouselView, IndicatorView label Aug 27, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Sep 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-controls-collectionview CollectionView, CarouselView, IndicatorView platform/android 🤖 potential-regression This issue described a possible regression on a currently supported version., verification pending t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants