CommunityToolkit / CommunityToolkit/Maui

[BUG] MediaElement 7.0.0 and 8.0.0 causes crash on iOS 26.1 when navigating shell pages

Open
#3,066 9 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C#
Stars
2.7k
Forks
500
Avg merge
2d 14h
Merged PRs (30d)
7

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Did you read the "Reporting a bug" section on Contributing file?

- [x] I have read the "Reporting a bug" section on Contributing file: https://github.com/CommunityToolkit/Maui/blob/main/CONTRIBUTING.md#reporting-a-bug

### Current Behavior

This is not an issue on Windows, MacCatalyst or Android.

When a MediaElement is present on a page then navigating pages using the shell menu causes a `UIViewControllerHierarchyInconsistency ` crash on **iOS 26.1** onwards. It works fine on 26.0.1 and below and fails on 26.1 and above so looks like it was introduced by some change in 26.1.

It works on the 1st navigation but happens on the 2nd navigation attempt regardless of which page you're navigating to. Once you've navigated the second time the Shell navigation becomes unresponsive.

### Expected Behavior

Navigation should not become unresponsive after navigation between pages on iOS.

### Steps To Reproduce

1. Open and run the solution from the reproduction repository targeted at an iOS simulator
2. Using the shell hamburger, navigate to Projects then navigate back to Dashboard
3. Crashes and navigation is no longer responsive

### Link to public reproduction project repository

https://bitbucket.org/KeithBoynton/media-element-shell-issue/src/master/

### Environment

```markdown
- .NET MAUI MediaElement: 7.0.0
- OS: iOS 26.1
- .NET MAUI: 10.0.31
```

### Anything else?

Crash looks like this (full dump attached):
```
Microsoft.Maui.Controls.Handlers.Compatibility.ShellRenderer: Warning: Failed on changing current item

ObjCRuntime.ObjCException: Objective-C exception thrown. Name: UIViewControllerHierarchyInconsistency Reason: child view controller: should have parent view controller: but actual parent is:
```

Not sure whether it's relevant but this is the only "similar" issue I could find:
https://github.com/CommunityToolkit/Maui/issues/1110

[MediaElementCrash.txt](https://github.com/user-attachments/files/25094488/MediaElementCrash.txt)

Contributor guide

Open the contributing guide

Research direction

Start with the linked MediaElement shell reproduction repository and run its solution on an iOS simulator targeting iOS 26.1. Follow the Projects-to-Dashboard navigation steps, then inspect the attached crash dump and the reported UIViewControllerHierarchyInconsistency. Done means repeated Shell navigation with MediaElement no longer crashes or becomes unresponsive on iOS 26.1 and later.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, ios
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.