-
Notifications
You must be signed in to change notification settings - Fork 441
Description
Is there an existing issue for this?
- I have searched the existing issues
Did you read the "Reporting a bug" section on Contributing file?
- 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
Switching the camera between front and rear causes the app to crash on Windows. Works fine on Android and iOS.
Expected Behavior
Should be able to switch between the available camera on all platforms without any crashes.
Steps To Reproduce
- Open and run the solution on Windows.
- Click the "Switch Camera" Button
- Notice the app crash.
Link to public reproduction project repository
https://github.com/ruc12127/CameraViewWindowsCrash
Environment
- .NET MAUI CommunityToolkit.Maui.Camera: 2.0.2
- OS: Windows 10
- .NET MAUI: 9.0.30
Exception Details
System.Runtime.InteropServices.COMException (0xC00D36B4): The data specified for the media type is invalid, inconsistent, or not supported by this object.
The data specified for the media type is invalid, inconsistent, or not supported by this object.
at CommunityToolkit.Maui.Core.CameraManager.PlatformUpdateResolution(Size resolution, CancellationToken token) in //src/CommunityToolkit.Maui.Camera/CameraManager.windows.cs:line 204
at CommunityToolkit.Maui.Core.CameraManager.d__21.MoveNext() in //src/CommunityToolkit.Maui.Camera/CameraManager.windows.cs:line 164
at CommunityToolkit.Maui.Core.CameraManager.UpdateCurrentCamera(CameraInfo cameraInfo, CancellationToken token) in //src/CommunityToolkit.Maui.Camera/CameraManager.shared.cs:line 82
at CommunityToolkit.Maui.Core.Handlers.CameraViewHandler.MapSelectedCamera(CameraViewHandler handler, ICameraView view) in //src/CommunityToolkit.Maui.Camera/Handlers/CameraViewHandler.shared.cs:line 158
at System.Threading.Tasks.Task.<>c.b__128_0(Object state)
at Microsoft.UI.Dispatching.DispatcherQueueSynchronizationContext.<>c__DisplayClass2_0.b__0()
--- End of stack trace from previous location ---
at WinRT.ExceptionHelpers.g__Throw|38_0(Int32 hr)
at ABI.Windows.ApplicationModel.Core.IUnhandledErrorMethods.Propagate(IObjectReference _obj)
at Microsoft.AppCenter.Utils.ApplicationLifecycleHelperWinUI.<.ctor>b__0_3(Object sender, UnhandledErrorDetectedEventArgs eventArgs)
--- End of stack trace from previous location ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()