-
Notifications
You must be signed in to change notification settings - Fork 516
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
Simple net8.0-ios app - native crash at startup (Avalonia XPAT project) #20657
Comments
I can reproduce with the iOS 17.4 simulator, but not the iOS 17.2 simulator. Looks like we're not the only ones hit by this: solid-software/flutter_vlc_player#476 |
FWIW the apps work fine on device. |
This worked for me. Note that you may still run into dotnet/runtime#98941 if you're not using the latest version of .NET (.NET 8.0.300), which behaves very similarly (it only has a different stack trace). In any case I believe this to be a bug in the iOS Simulator, so I'm closing this issue. The crash is related to OpenGL, and Apple isn't spending much time on OpenGL (it's been deprecated for 5 years now), so I wouldn't be surprised if they introduced a bug accidentally. This also means that they're less likely to fix any bugs as well, so even if we filed an issue with Apple, I'd be surprised if they actually fixed the problem. Feel free to reopen if you disagree and think it's a bug in xamarin-macios, but we'll need an equivalent Xcode project that works to confirm it's indeed a problem on our side, and also to compare and see where things go wrong. However, maybe there's a way to make Avalonia use Metal instead of OpenGL? That might be a better way forward than trying to make OpenGL code work. |
Wow... thank you for the fast response. FYI - it seems metal support is in the making, but that does not help us now.... I'll try the simulator 15.2 and ping back here. Thanks! |
Yes, metal rendering is supported now, but disabled by default in stable versions. @gentledepp nightly 11.2 builds have metal enabled by default. Or you can enable them in 11.1 as well via |
@rolfbjarne I just tested this issue with and without Metal rendering. With the minimal sample, only iossimulator-x64 is important to solve the issue. And it works with both OpenGL and Metal rendering. At the same time, if arm64 is used, it will crash with both renderers. |
This works for me in the Xcode 16.1 arm64 simulator: diff --git a/AvaloniaiOSCrash_v11.0.10/AvaloniaiOSCrash01/AvaloniaiOSCrash01.iOS/AppDelegate.cs b/AvaloniaiOSCrash_v11.0.10/AvaloniaiOSCrash01/AvaloniaiOSCrash01.iOS/AppDelegate.cs
index 55e9b6e..21a6f99 100644
--- a/AvaloniaiOSCrash_v11.0.10/AvaloniaiOSCrash01/AvaloniaiOSCrash01.iOS/AppDelegate.cs
+++ b/AvaloniaiOSCrash_v11.0.10/AvaloniaiOSCrash01/AvaloniaiOSCrash01.iOS/AppDelegate.cs
@@ -19,6 +19,7 @@ namespace AvaloniaiOSCrash01.iOS
protected override AppBuilder CustomizeAppBuilder(AppBuilder builder)
{
return base.CustomizeAppBuilder(builder)
+ .With(new iOSPlatformOptions { RenderingMode = new [] { iOSRenderingMode.Metal } })
.WithInterFont()
.UseReactiveUI();
}
diff --git a/AvaloniaiOSCrash_v11.0.10/AvaloniaiOSCrash01/Directory.Build.props b/AvaloniaiOSCrash_v11.0.10/AvaloniaiOSCrash01/Directory.Build.props
index 3a82054..48fa85e 100644
--- a/AvaloniaiOSCrash_v11.0.10/AvaloniaiOSCrash01/Directory.Build.props
+++ b/AvaloniaiOSCrash_v11.0.10/AvaloniaiOSCrash01/Directory.Build.props
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Nullable>enable</Nullable>
- <AvaloniaVersion>11.0.10</AvaloniaVersion>
+ <AvaloniaVersion>11.2.0</AvaloniaVersion>
</PropertyGroup>
</Project> |
Steps to Reproduce
Expected Behavior
The app starts and shows "hello avalonia" or the like
Actual Behavior
We get a native crash:
Environment
Version information
Our mac buildserver is running on am M1 chipset.
Build Logs
msbuild.zip
Example Project (If Possible)
https://github.com/gentledepp/Repro_AvaloniaiOSCrash
use any of the 3 sample solutions (they are all "File-New" Avalonia XPat projects.
Note we got the tip to force the x64 ios simulator by adding
to the *.iOScsproj but that did not help
The text was updated successfully, but these errors were encountered: