dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.26k stars 1.76k forks source link

MediaPicker.CapturePhotoAsync Crashes Android Emulator Debug Session #25816

Closed Mike-E-angelo closed 19 hours ago

Mike-E-angelo commented 1 week ago

Discussed in https://github.com/dotnet/maui/discussions/25801

Recording/issue created here: https://developercommunity.visualstudio.com/t/MediaPickerCapturePhotoAsync-Crashes-An/10788592

Originally posted by **Mike-E-angelo** November 12, 2024 I am attempting to run this SLN: https://github.com/dotnet/maui-samples/blob/main/8.0/PlatformIntegration/PlatformIntegrationDemos/PlatformIntegrationDemo.sln Whenever I run the Media Picker scenario and load the camera via `MediaPicker.CapturePhotoAsync` the debugger detaches and the application stops working. No visible messages/errors/warnings are displayed in the debugger. I would greatly appreciate any pointers on how to diagnose this to determine what is occurring. Thank you for any assistance you can provide! 🙏
mattleibow commented 3 days ago

I think the developer community is the right place for this, so I am going to add the move to vs feedback label, but requires no action. I'll keep it in the issues list for a bit to make sure we get the IDE team to have a look.

mattleibow commented 3 days ago

Maybe attach an android logcat.... https://learn.microsoft.com/en-us/xamarin/android/deploy-test/debugging/android-debug-log?tabs=windows

Maybe there is a reason it crashes.

Mike-E-angelo commented 19 hours ago

Thank you @mattleibow for your patience and investigation while I figure this out with a massive crash course in my life over the past week. 😅 The primary issue here is that I was running Hyper-V and running everything within a virtual machine. Even though my Hyper-V host has 32 processors overclocked to 4.8Ghz, this really was not enough to adequately host an Android emulator, leading to these issues.

I can confirm that standing up a new machine (with half the processors) and running the emulator on bare metal is a much much much improved experience and works much better.

I appreciate all your efforts out there. Thank you for all that you do! 🙏