Maui icon indicating copy to clipboard operation
Maui copied to clipboard

[BUG] Basic MediaElement crashes when targetting iOS 17.4 yet works fine on 17.2

Open KeithBoynton opened this issue 1 year ago • 3 comments

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

Simply having a MediaElement on a ContentPage crashes on startup when the project is targetting iOS 17.4 yet it works just fine when targetting 17.2.

Here is the interesting part of the stack trace:

Managed Stacktrace:
  at <unknown> <0xffffffff>
  at ObjCRuntime.Messaging:IntPtr_objc_msgSend <0x00098>
  at AVKit.AVPlayerViewController:.ctor <0x00096>
  at CommunityToolkit.Maui.Core.Views.MediaManager:CreatePlatformView <0x0003e>
  at CommunityToolkit.Maui.Core.Handlers.MediaElementHandler:CreatePlatformView <0x000fc>
  at Microsoft.Maui.Handlers.ViewHandler`2:OnCreatePlatformView <0x0008a>
  at Microsoft.Maui.Handlers.ViewHandler:OnCreatePlatformElement <0x0001e>
  at Microsoft.Maui.Handlers.ElementHandler:CreatePlatformElement <0x0001e>

Full Output attached.. ApplicationOutput_SampleProject.txt

Expected Behavior

I expect the solution to run without crashing.

Steps To Reproduce

  1. Clone and load the attached sample project
  2. Run it and target it at any simulator based on iOS 17.4
  3. Observe the crash immediately
  4. Run it and target it at any simulator based on iOS 17.2
  5. Observe it run successfully with no crash

Link to public reproduction project repository

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

Environment

- .NET MAUI CommunityToolkit.Maui.MediaElement: 3.1.1
- OS: macOS Sonoma 14.4.1
- .NET MAUI: 8.0.21

Anything else?

No response

KeithBoynton avatar May 04 '24 12:05 KeithBoynton

do you use xcode 15.3 in order to support newer versions of the iOS sdk? 15.3 isn't supported yet, as far as I know, resulting in lots of crashes - this could be entirely unrelated to the toolkit.

MitchBomcanhao avatar May 06 '24 08:05 MitchBomcanhao

Yes thanks @MitchBomcanhao also see https://github.com/dotnet/maui/issues/21057

Can you please confirm @KeithBoynton ?

jfversluis avatar May 06 '24 08:05 jfversluis

Yes thanks guys, I am indeed using 15.3... I've subscribed to 21057 so I can see when that is resolved and hopefully this IS unrelated to the toolkit.. fingers crossed

KeithBoynton avatar May 07 '24 19:05 KeithBoynton

MediaElement running on 17.4 iOS emulator using Xcode 14.3 using Mac Build host from Windows 11. Using current main. @vhugogarcia

Sample Video:

https://github.com/CommunityToolkit/Maui/assets/4167863/6565da98-68e0-4475-9fe4-d008a1cd85b4

ne0rrmatrix avatar Jun 18 '24 04:06 ne0rrmatrix

Thanks @ne0rrmatrix for helping us to run some tests. I'm closing this issue, we can reopen it again in case the issue appears again.

vhugogarcia avatar Jun 18 '24 13:06 vhugogarcia