Xamarin.forms: Listview binded to ObservableCollection crashes on Android when selecting item.

Created on 11 Jun 2019  ·  9Comments  ·  Source: xamarin/Xamarin.Forms

Description

Listview binded to ObservableCollection shows data correctly but when selecting item OnItemTapped event crashes app. I added break to event handler but it is never reach.

Here is the datasource
public ObservableCollection ZoneCompinedInfos
{
get { return zoneCompinedInfos; }
set
{
zoneCompinedInfos = value;
this.OnPropertyChanged();
}
}

And here is how i fill it when data is updated.

ZoneCompinedInfos = new ObservableCollection(infos);

Of course I cannot show alldata due it is our app but this should give some idea?

Steps to Reproduce

  1. Listview binded to ObservableCollection()
  2. Listview shows data using DataTemplates to get binging to class properties.
  3. Selecting item crashes app.

Expected Behavior

App shows View dispalying details about selected item

Actual Behavior

App crashes before hitting event handler break point.

Basic Information

  • Version with issue: Latest stable Xamarin version 4.0.0.482894
  • Last known good version: 3.5.0.274416 works just fine
  • IDE:
  • Platform Target Frameworks: tested on Android

    • iOS:

    • Android: 8.1

    • UWP:

  • Android Support Library Version:
  • Nuget Packages:
  • Affected Devices:

Screenshots

Reproduction Link

listview Android needs-info ❓ needs-repro ❔ unverified bug

All 9 comments

Thanks for your report! Might I trouble you to maybe provide a few more things:

  • A reproduction sample project showing this issues
  • The details of the error message or crash that you are experiencing

I see you only stated Android do you also have any other platforms in there? Are they working as they should?

  • I can try to make some kind of mock up app. Quite busy at the moment.

  • I will update nuget later today and see if I can get the error report. It was long! Something related to Fatal signal 11 (SIGSEGV).
    We are only using Android at the moment so now knowledge from other platforms.

I attached the error from visual studio Debug window. Quite impressive :-)

error.txt

I see! Unfortunately the cause is still not very clear from this logs. If at all possible we would still like to receive a reproduction so we can investigate what exactly is going on.

From the log, the issue is not in Xamarin.Forms but in the layer below, Xamarin.Android.
Possibly issue 3112 or issue 3178.
If it's not one of them, open a new issue on the Xamarin.Android repository here.

I made simple testapp that has just listview that is tied to ObservableCollection() but unfortunaltely it works. Might be a sum of things this our application crash because as I said application is quite comblex. It receives data from server on certain interval and updated among other things this view. That I do not quite understand why it is working just fine with older Xamarin version? All other things are working and data is updated correctly to listview but when I click it to see more info application crashes. I will try to dig deeper but my time is limited for this. If now one other has faced this then there is something else in app causing this? Those issues suggested above do not quite match this one.

A SIGSEGV is a crash from the Xamarin.Android/Mono runtime.
Nothing in Xamarin.Forms can cause this. When Xamarin.Android (Forms) fail you will have a JavaException, this is not the case here so the problem is not from your code neither in the Xamarin.Android Framework. The issue is a regression in the runtime layer.
The only thing that you can do, is openning an issue in the Xamarin.Android repository and join your crahs log.

Ok. Copied this there and attached error log. Should I now close this one? Have not used this so often.

Yes, you can close it here.

Issue moved to Xamarin.Android repository, issue #3198.

Was this page helpful?
0 / 5 - 0 ratings