Skip to content

SwipeItems referencing causes crash on Android. [Duplicate of #18429] #19331

Description

@DxsSucuk

Description

This is a duplicate of #18429, since this Issue has not been resolved and still exists with the latest .NET 8 release.

Steps to Reproduce

  1. Create a MAUI Project.
  2. Make a CollectionView with a Itemtemplate which has a SwipeView.
  3. Make a variable of the typ SwipeItems
  4. Bind that variable to either LeftSwipeItems or RightSwipeItems
  5. Try sliding a entry to the side.
  6. Try sliding another one to the side, without sliding the previous one back.
  7. Observe Java IllegalArgument!

Link to public reproduction project repository

https://github.com/DxsSucuk/Maui.DataGrid/tree/feature/swipeItem

Version with bug

8.0.3

Is this a regression from previous behavior?

No, this is something new

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android 12

Did you find any workaround?

Adding the SwipeItems in the Datatemplate, but that is not a actual solution since it stops any flexability.

Relevant log output

No response

Activity

  1. mattleibow commented on Dec 11, 2023

    @mattleibow
    Member

    I think this is because your bindable property has a default value of swipe items, and this means there is a single swipe items value that all collection view items are referencing. The best way would be to use the factory creator instead of the value directly:

        public static readonly BindableProperty LeftSwipeItemsProperty =
            BindablePropertyExtensions.Create(() => new SwipeItems());
    
        public static readonly BindableProperty RightSwipeItemsProperty =
            BindablePropertyExtensions.Create(() => new SwipeItems());

    Let me know if this fixes your issue.

  2. added
    legacy-area-controlsLabel, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor
    on Dec 13, 2023
  3. DxsSucuk commented on Dec 15, 2023

    @DxsSucuk
    Author

    I think this is because your bindable property has a default value of swipe items, and this means there is a single swipe items value that all collection view items are referencing. The best way would be to use the factory creator instead of the value directly:

        public static readonly BindableProperty LeftSwipeItemsProperty =
            BindablePropertyExtensions.Create(() => new SwipeItems());
    
        public static readonly BindableProperty RightSwipeItemsProperty =
            BindablePropertyExtensions.Create(() => new SwipeItems());

    Let me know if this fixes your issue.

    Sadly did not fix it, it caused the SwipeItems to no longer be visible.

  4. ghost added
    s/needs-attentionIssue has more information and needs another look
    on Dec 15, 2023
  5. ghost removed
    s/needs-infoIssue needs more info from the author
    on Dec 15, 2023
  6. PureWeen commented on Dec 16, 2023

    @PureWeen
    Member

    Duplicate of #18429

  7. added this to the Backlog milestone on Dec 16, 2023
  8. removed
    legacy-area-controlsLabel, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor
    on May 10, 2024
  9. added a commit that references this issue on Mar 23, 2026
    5d120fc
  10. added a commit that references this issue on Mar 24, 2026
    87825c6
  11. added a commit that references this issue on Mar 30, 2026
    c6f2447
  12. added a commit that references this issue on Apr 4, 2026
    c6a72ac
  13. added a commit that references this issue on Apr 8, 2026
  14. modified the milestones: Backlog, .NET 10 SR6 on Apr 29, 2026
  15. locked and limited conversation to collaborators on May 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions