Skip to content

[Android] Fix crash starting the swipe on SwipeView inside CollectionView#27669

Merged
jfversluis merged 3 commits intomainfrom
fix-26328
Feb 25, 2025
Merged

[Android] Fix crash starting the swipe on SwipeView inside CollectionView#27669
jfversluis merged 3 commits intomainfrom
fix-26328

Conversation

@jsuarezruiz
Copy link
Copy Markdown
Contributor

Description of Change

Fix crash starting the swipe on SwipeView inside CollectionView.

I have not been able to reproduce the crash on emulators or device (Pixel 8 Android 15) so I have applied changes based on reviewing the log attached to the issue.

Draft PR until we can reproduce it.

Issues Fixed

Fixes #26328

@sheiksyedm
Copy link
Copy Markdown
Contributor

@jsuarezruiz Since the crash is reproducing randomly on the Android platform in a Windows machine, we are unable to test the fix precisely. However, after applying the fix, the issue did not reproduce in multiple attempts. Additionally, we ensured that without the fix, the issue was reproduced in random scenarios. So, hope this PR will resolve the issue

@jsuarezruiz
Copy link
Copy Markdown
Contributor Author

/rebase

@jsuarezruiz jsuarezruiz marked this pull request as ready for review February 21, 2025 12:49
Copilot AI review requested due to automatic review settings February 21, 2025 12:49
@jsuarezruiz jsuarezruiz requested a review from a team as a code owner February 21, 2025 12:49
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.

Files not reviewed (1)
  • src/Controls/tests/TestCases.HostApp/Issues/Issue26328.xaml: Language not supported
Comments suppressed due to low confidence (3)

src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue26328.cs:17

  • The test case should verify that the swipe items are correctly removed and that the crash is fixed.
[Category(UITestCategories.SwipeView)]

src/Core/src/Platform/Android/MauiSwipeView.cs:529

  • Ensure that the behavior introduced by the null check for _contentView.IsDisposed() is covered by tests.
if (_contentView == null || _contentView.IsDisposed() || _actionView != null)

src/Core/src/Platform/Android/MauiSwipeView.cs:548

  • Ensure that the behavior introduced by the null check for swipeItem is covered by tests.
AView? swipeItem = item?.ToPlatform(MauiContext);

@jfversluis jfversluis added this to the .NET 9 SR5 milestone Feb 25, 2025
@jfversluis jfversluis merged commit 515312b into main Feb 25, 2025
123 checks passed
@jfversluis jfversluis deleted the fix-26328 branch February 25, 2025 10:51
tj-devel709 pushed a commit that referenced this pull request Mar 3, 2025
…View (#27669)

* Added repro sample

* Added UITest

* Some changes based on the issue attached log (cannot repro the issue)
@github-actions github-actions bot locked and limited conversation to collaborators Mar 28, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SwipeView causes Java.Lang.IllegalArgumentException: Cannot add a null child view to a ViewGroup

4 participants