AvaloniaUI / AvaloniaMauiHybrid

Brings templated controls, pixel perfect rendering, animations, styling and composition to Maui
MIT License
170 stars 13 forks source link

iOS Crash with Hot Reload enabled #23

Open metal450 opened 1 month ago

metal450 commented 1 month ago

Hi,

When trying out the AvaloniaSample.iOS sample project (Visual Studio 17.10.3 for Windows, Phone SE 3rd gen tethered for "Hot Reload"):

If I try the MauiSample project, it works - this only occurs with the AvaloniaSample.

What could be wrong?

metal450 commented 1 month ago

Looks like someone else encountered this & reported it back in May here: https://github.com/xamarin/xamarin-macios/issues/20658

Is this "Sample Project" not expected to work?

metal450 commented 1 month ago

Addendum: Made sure to update Visual Studio to the latest version (17.10.5). Sample project still crashes.

maxkatz6 commented 1 month ago

Is this "Sample Project" not expected to work?

It does. But mobile .NET SDK is frequently breaks, sometimes Apple does it, and sometimes Visual Studio.

To isolate this problem, can you:

  1. Try to run without Visual Studio (VSCode is fine, Rider better, but ideally just dotnet run (it's a bit complicated with .NET though)
  2. Try to disable VS Hot Reload, as it is known to be hardcoded to MAUI, and is hard to get working even with this plugin: Tools > Options > Debugging > Hot Reload.

Probably not related to this issue, but also another known problem with simulator:

  1. Try to set iossimulator-x64 runtime identifier, by default iossimulator-arm64 is used.
  2. Try to switch to Metal rendering as per https://github.com/xamarin/xamarin-macios/issues/20657#issuecomment-2143514751
metal450 commented 3 weeks ago

Hi, thanks for the reply

Try to disable VS Hot Reload, as it is known to be hardcoded to MAUI, and is hard to get working even with this plugin

My whole intention/goal in adding Maui to my Avalonia app is to be able to use Hot Restart (per https://github.com/AvaloniaUI/Avalonia/discussions/14220#discussioncomment-9853495). If I don't use Hot Restart, and instead build & run through a remote Mac, then it indeed works. However, that sort of defeats the purpose here - in that case might as well just have Avalonia alone ;)

Try to run without Visual Studio (VSCode is fine, Rider better, but ideally just dotnet run

Tried it with Rider, but I couldn't find a way to enable Hot Restart there - perhaps that's Visual Studio specific.

Probably not related to this issue, but also another known problem with simulator

I was using a physical tethered device via Hot Restart (not simulator)

Thanks again