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

ListView w/ Binding, Delete first item -> Crash (Maui RC3, Android) #7406

Closed
ToolmakerSteve opened this issue May 22, 2022 · 2 comments · Fixed by #7485
Closed

ListView w/ Binding, Delete first item -> Crash (Maui RC3, Android) #7406

ToolmakerSteve opened this issue May 22, 2022 · 2 comments · Fixed by #7485
Assignees
Labels
area-controls-listview ListView and TableView fixed-in-6.0.400 Look for this fix in 6.0.400! p/1 Work that is important, and has been scheduled for release in this or an upcoming sprint platform/android 🤖 s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Milestone

Comments

@ToolmakerSteve
Copy link

Description

Crash on Android. (Works on Windows.)

Repo: https://github.com/ToolmakerSteve/MauiBug_ListView_Delete

StackOverflow: https://stackoverflow.com/questions/72339216/net-maui-app-crashes-on-basic-delete-from-list

Crash dump:
Maui ListView - Delete Item - Crash.txt

Steps to Reproduce

  • Bind a ListView to ObservableCollection in a ViewModel.
  • Add 2 or 3 items.
  • With a button on each item, use Command to delete that item.
  • If it is NOT the last item in list, crashes on Android. (Works on Windows.)

Version with bug

Release Candidate 3 (current)

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android API 29 (did not test others)

Did you find any workaround?

Perhaps use CollectionView instead of ListView.

Relevant log output

// See above attachment Maui ListView - Delete Item - Crash.txt for full dump.
[nyname.mauiapp] java_vm_ext.cc:570] JNI DETECTED ERROR IN APPLICATION: JNI CallObjectMethodA called with pending exception java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
[nyname.mauiapp] java_vm_ext.cc:570]   at void android.view.ViewGroup.addViewInner(android.view.View, int, android.view.ViewGroup$LayoutParams, boolean) (ViewGroup.java:5106)
...
[nyname.mauiapp] java_vm_ext.cc:570]     in call to CallObjectMethodA
[nyname.mauiapp] java_vm_ext.cc:570]     from android.view.View crc64e1fb321c08285b90.ListViewAdapter.n_getView(int, android.view.View, android.view.ViewGroup)
**Java.Lang.IllegalStateException:** 'Loading...'
@ToolmakerSteve ToolmakerSteve added s/needs-verification Indicates that this issue needs initial verification before further triage will happen t/bug Something isn't working labels May 22, 2022
@ToolmakerSteve
Copy link
Author

ToolmakerSteve commented May 22, 2022

Verified that above repo works (no crash on Android) if use CollectionView instead of ListView (and remove ViewCell line from ItemTemplate).

@jfversluis jfversluis added platform/android 🤖 area-controls-listview ListView and TableView and removed s/needs-verification Indicates that this issue needs initial verification before further triage will happen labels May 23, 2022
@jsuarezruiz jsuarezruiz self-assigned this May 23, 2022
@rmarinho rmarinho reopened this May 23, 2022
@Redth Redth added this to the 6.0.3xx-sr1 milestone May 23, 2022
@VincentBu
Copy link

repro with vs main build(32523.339.main).

@VincentBu VincentBu added the s/verified Verified / Reproducible Issue ready for Engineering Triage label May 24, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Jun 25, 2022
@samhouts samhouts added the p/1 Work that is important, and has been scheduled for release in this or an upcoming sprint label Jul 12, 2022
@samhouts samhouts added the fixed-in-6.0.400 Look for this fix in 6.0.400! label Feb 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-controls-listview ListView and TableView fixed-in-6.0.400 Look for this fix in 6.0.400! p/1 Work that is important, and has been scheduled for release in this or an upcoming sprint platform/android 🤖 s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants