Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS Crash with Hot Reload enabled #23

Open
metal450 opened this issue Jul 21, 2024 · 4 comments
Open

iOS Crash with Hot Reload enabled #23

metal450 opened this issue Jul 21, 2024 · 4 comments

Comments

@metal450
Copy link

metal450 commented Jul 21, 2024

Hi,

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

  • I'm able to auto-provision successfully
  • I'm able to deploy to the tethered iPhone (the app appears on the home screen)
  • When I launch the app, I see the purple .NET load screen
  • But then it crashes with No class inheriting from a valid Application Delegate found in /var/mobile/Containers/Data/Application/457228A1-2559-44E4-810B-4C91859D26BE/Documents/AvaloniaSample.iOS.content/AvaloniaSample.iOS.dll.

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

What could be wrong?

@metal450
Copy link
Author

Looks like someone else encountered this & reported it back in May here: xamarin/xamarin-macios#20658

Is this "Sample Project" not expected to work?

@metal450
Copy link
Author

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

@maxkatz6
Copy link
Member

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:
3. Try to set iossimulator-x64 runtime identifier, by default iossimulator-arm64 is used.
4. Try to switch to Metal rendering as per xamarin/xamarin-macios#20657 (comment)

@metal450
Copy link
Author

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 AvaloniaUI/Avalonia#14220 (reply in thread)). 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

@maxkatz6 maxkatz6 changed the title AvaloniaSample.iOS Crash iOS Crash with Hot Reload enabled Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants