question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] MediaElement Crash On IOS

See original GitHub issue

Is there an existing issue for this?

  • I have searched the existing issues

Did you read the “Reporting a bug” section on Contributing file?

Current Behavior

I’m trying to implement Media Element on IOS, for some reason the app is stopped/disabled, the script works fine on Android

Terminating app due to uncaught exception 'UIViewControllerHierarchyInconsistency', reason: 'child view controller:<AVPlayerViewController: 0x1167e4800> should have parent view controller:<Microsoft_Maui_Platform_PageViewController: 0x113a15d50> but actual parent is:<Microsoft_Maui_Controls_Platform_ModalWrapper: 0x117ec2850>'

Android Platform :

https://user-images.githubusercontent.com/43956454/219947958-3ec0597b-00f6-4dd9-ac08-022e23162dfc.mp4

IOS Platform :

https://user-images.githubusercontent.com/43956454/219948120-d4fd028c-2f19-402f-9b2e-57511eefeb6f.MP4

Output Logs:


Resolved pending breakpoint at 'AuthIntrodactionView.xaml.cs:9,1' to void Mobile.AuthPages.Views.AuthIntrodactionView..ctor () [0x00007].
Resolved pending breakpoint at 'AuthIntrodactionViewModel.cs:36,1' to void Mobile.AuthPages.ViewModels.AuthIntrodactionViewModel..ctor () [0x0001a].
Resolved pending breakpoint at 'AuthIntrodactionViewModel.cs:39,1' to void Mobile.AuthPages.ViewModels.AuthIntrodactionViewModel..ctor () [0x00026].
The thread 0x6 has exited with code 0 (0x0).
The thread 0xd has exited with code 0 (0x0).
Thread finished: <Thread Pool> #6
Thread finished: <Thread Pool> #13
Thread started: <Thread Pool> #19
2023-02-19 13:31:35.382 Xamarin.PreBuilt.iOS[383:5841] *** Terminating app due to uncaught exception 'UIViewControllerHierarchyInconsistency', reason: 'child view controller:<AVPlayerViewController: 0x1167e4800> should have parent view controller:<Microsoft_Maui_Platform_PageViewController: 0x113a15d50> but actual parent is:<Microsoft_Maui_Controls_Platform_ModalWrapper: 0x117ec2850>'
*** First throw call stack:
(0x1b14a9a34 0x1aa9c9958 0x1b158e34c 0x1b35f904c 0x1b35f8e78 0x1b3565228 0x1b3565264 0x1b3565264 0x1b3565264 0x1b3565264 0x1b356d934 0x1b37e796c 0x1b37e6f00 0x1b3cdba28 0x1b373e5d4 0x1b37e69ec 0x1b3730ad4 0x1b37309b4 0x1b3c4f708 0x1b36e1c24 0x1b36e1b60 0x1b83b7850 0x1b83b87c8 0x1b8399f18 0x1b8399b90 0x1b1533828 0x1b15174a8 0x1b151bb58 0x1e771b984 0x1b38c6628 0x1b38c62a0 0x1022dc5a4 0x1025f5aa0 0x1025f47c0 0x1025ea19c 0x1025e7d70 0x1025b8d78 0x102507d70 0x10250ecc0 0x1024cfa30 0x1024d8e74 0x1025f5a6c 0x1025f47f8 0x1025ea19c 0x1025e7d70 0x1025b8d78 0x102507d70 0x10250e618 0x1025bdf74 0x1023069bc 0x10262
4104 0x1ce1e5df0)

Resolved pending breakpoint at 'AuthIntrodactionView.xaml.cs:9,1' to void Mobile.AuthPages.Views.AuthIntrodactionView..ctor () [0x00007].
Resolved pending breakpoint at 'AuthIntrodactionViewModel.cs:36,1' to void Mobile.AuthPages.ViewModels.AuthIntrodactionViewModel..ctor () [0x0001a].
Resolved pending breakpoint at 'AuthIntrodactionViewModel.cs:39,1' to void Mobile.AuthPages.ViewModels.AuthIntrodactionViewModel..ctor () [0x00026].
The thread 0x6 has exited with code 0 (0x0).
The thread 0xd has exited with code 0 (0x0).
Thread finished: <Thread Pool> #6
Thread finished: <Thread Pool> #13
Thread started: <Thread Pool> #19
2023-02-19 13:31:35.382 Xamarin.PreBuilt.iOS[383:5841] *** Terminating app due to uncaught exception 'UIViewControllerHierarchyInconsistency', reason: 'child view controller:<AVPlayerViewController: 0x1167e4800> should have parent view controller:<Microsoft_Maui_Platform_PageViewController: 0x113a15d50> but actual parent is:<Microsoft_Maui_Controls_Platform_ModalWrapper: 0x117ec2850>'
*** First throw call stack:
(0x1b14a9a34 0x1aa9c9958 0x1b158e34c 0x1b35f904c 0x1b35f8e78 0x1b3565228 0x1b3565264 0x1b3565264 0x1b3565264 0x1b3565264 0x1b356d934 0x1b37e796c 0x1b37e6f00 0x1b3cdba28 0x1b373e5d4 0x1b37e69ec 0x1b3730ad4 0x1b37309b4 0x1b3c4f708 0x1b36e1c24 0x1b36e1b60 0x1b83b7850 0x1b83b87c8 0x1b8399f18 0x1b8399b90 0x1b1533828 0x1b15174a8 0x1b151bb58 0x1e771b984 0x1b38c6628 0x1b38c62a0 0x1022dc5a4 0x1025f5aa0 0x1025f47c0 0x1025ea19c 0x1025e7d70 0x1025b8d78 0x102507d70 0x10250ecc0 0x1024cfa30 0x1024d8e74 0x1025f5a6c 0x1025f47f8 0x1025ea19c 0x1025e7d70 0x1025b8d78 0x102507d70 0x10250e618 0x1025bdf74 0x1023069bc 0x10262
4104 0x1ce1e5df0)

2023-02-19 13:31:35.383 Xamarin.PreBuilt.iOS[383:5841] *** Terminating app due to uncaught exception 'UIViewControllerHierarchyInconsistency', reason: 'child view controller:<AVPlayerViewController: 0x1167e4800> should have parent view controller:<Microsoft_Maui_Platform_PageViewController: 0x113a15d50> but actual parent is:<Microsoft_Maui_Controls_Platform_ModalWrapper: 0x117ec2850>'
*** First throw call stack:
(0x1b14a9a34 0x1aa9c9958 0x1b158e34c 0x1b35f904c 0x1b35f8e78 0x1b3565228 0x1b3565264 0x1b3565264 0x1b3565264 0x1b3565264 0x1b356d934 0x1b37e796c 0x1b37e6f00 0x1b3cdba28 0x1b373e5d4 0x1b37e69ec 0x1b3730ad4 0x1b37309b4 0x1b3c4f708 0x1b36e1c24 0x1b36e1b60 0x1b83b7850 0x1b83b87c8 0x1b8399f18 0x1b8399b90 0x1b1533828 0x1b15174a8 0x1b151bb58 0x1e771b984 0x1b38c6628 0x1b38c62a0 0x1022dc5a4 0x1025f5aa0 0x1025f47c0 0x1025ea19c 0x1025e7d70 0x1025b8d78 0x102507d70 0x10250ecc0 0x1024cfa30 0x1024d8e74 0x1025f5a6c 0x1025f47f8 0x1025ea19c 0x1025e7d70 0x1025b8d78 0x102507d70 0x10250e618 0x1025bdf74 0x1023069bc 0x10262
4104 0x1ce1e5df0)
2023-02-19 13:31:35.383 Xamarin.PreBuilt.iOS[383:5841] *** Terminating app due to uncaught exception 'UIViewControllerHierarchyInconsistency', reason: 'child view controller:<AVPlayerViewController: 0x1167e4800> should have parent view controller:<Microsoft_Maui_Platform_PageViewController: 0x113a15d50> but actual parent is:<Microsoft_Maui_Controls_Platform_ModalWrapper: 0x117ec2850>'
*** First throw call stack:
(0x1b14a9a34 0x1aa9c9958 0x1b158e34c 0x1b35f904c 0x1b35f8e78 0x1b3565228 0x1b3565264 0x1b3565264 0x1b3565264 0x1b3565264 0x1b356d934 0x1b37e796c 0x1b37e6f00 0x1b3cdba28 0x1b373e5d4 0x1b37e69ec 0x1b3730ad4 0x1b37309b4 0x1b3c4f708 0x1b36e1c24 0x1b36e1b60 0x1b83b7850 0x1b83b87c8 0x1b8399f18 0x1b8399b90 0x1b1533828 0x1b15174a8 0x1b151bb58 0x1e771b984 0x1b38c6628 0x1b38c62a0 0x1022dc5a4 0x1025f5aa0 0x1025f47c0 0x1025ea19c 0x1025e7d70 0x1025b8d78 0x102507d70 0x10250ecc0 0x1024cfa30 0x1024d8e74 0x1025f5a6c 0x1025f47f8 0x1025ea19c 0x1025e7d70 0x1025b8d78 0x102507d70 0x10250e618 0x1025bdf74 0
x1023069bc 0x102624104 0x1ce1e5df0)
2023-02-19 13:31:35.384 Xamarin.PreBuilt.iOS[383:5841] *** Terminating app due to uncaught exception 'UIViewControllerHierarchyInconsistency', reason: 'child view controller:<AVPlayerViewController: 0x1167e4800> should have parent view controller:<Microsoft_Maui_Platform_PageViewController: 0x113a15d50> but actual parent is:<Microsoft_Maui_Controls_Platform_ModalWrapper: 0x117ec2850>'
*** First throw call stack:
(0x1b14a9a34 0x1aa9c9958 0x1b158e34c 0x1b35f904c 0x1b35f8e78 0x1b3565228 0x1b3565264 0x1b3565264 0x1b3565264 0x1b3565264 0x1b356d934 0x1b37e796c 0x1b37e6f00 0x1b3cdba28 0x1b373e5d4 0x1b37e69ec 0x1b3730ad4 0x1b37309b4 0x1b3c4f708 0x1b36e1c24 0x1b36e1b60 0x1b83b7850 0x1b83b87c8 0x1b8399f18 0x1b8399b90 0x1b1533828 0x1b15174a8 0x1b151bb58 0x1e771b984 0x1b38c6628 0x1b38c62a0 0x1022dc5a4 0x1025f5aa0 0x1025f47c0 0x1025ea19c 0x1025e7d70 0x1025b8d78 0x102507d70 0x10250ecc0 0x1024cfa30 0x1024d8e74 0x1025f5a6c 0x1025f47f8 0x1025ea19c 0x1025e7d70 0x1025b8d78 0x102507d70 0x10250
e618 0x1025bdf74 0x1023069bc 0x102624104 0x1ce1e5df0)

Expected Behavior

It should appear as on the Android device, the video should be visible in the background

Steps To Reproduce

  • This Issue in an existing project, I will create a repository as soon as possible.

Link to public reproduction project repository

  • This Issue in an existing project, I will create a repository as soon as possible.

Environment

- .NET MAUI CommunityToolkit : 4.0.0
- .NET MAUI CommunityToolkit MediaElement: 1.0.1
- OS: IPhone X IOS 16.2 
- .NET MAUI :

Anything else?

No response

Issue Analytics

  • State:closed
  • Created 7 months ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
jfversluiscommented, Feb 20, 2023

I’m pretty sure this is resolved in version 1.0.2, please try that and close the issue if that fixes it.

If not, please provide the requested reproduction sample. Thanks!

0reactions
Kremedcommented, Feb 21, 2023

Exactly, it worked as expected when updating to version 1.0.2. But to be a loop, I created a separate app with 1.0.1 and it worked too Thank you for your support

Read more comments on GitHub >

github_iconTop Results From Across the Web

Xamarin Forms: Native Crash Reporting in ios platform due ...
Recently I have implemented the MediaElement feature for playing audio and video files. This problem is occurring after playing the video using ...
Read more >
Xamarin Forms: Issue with MediaElement audio playing
After adding the custom renderer, there are some issues while playing audio in ios. After playing the first audio, the second and third...
Read more >
Xamarin.Forms changelog - Awesome .NET - LibHunt
MediaElement. "[Tizen] MediaElement control support" (#9634); Github #9742 - "[Bug] MediaElement crashes on iOS when given a URL and device has no ...
Read more >
App Crash Details Without Hassle with App Center ... - YouTube
Asking your user how a crash happened isn't usually very effective. Lucky for us there is now App Center Diagnostics! With this tool...
Read more >
Gerald Versluis (@jfversluis) / X
After months of hard work we finally merged it: the MediaElement for . ... NET MAUI on iOS/macOS, Android, Windows and Tizen ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found