Skip to content

Commit 857ebc5

Browse files
fix: disable AndroidEnableMarshalMethods to fix startup crash with no logs
AndroidEnableMarshalMethods=true generates build-time P/Invoke stubs that can crash in native code when combined with profiled AOT + trimming. The crash bypasses managed exception handling, producing no crash logs — matching the reported symptoms (black screen, rotated screen, silent crash). The default runtime-generated P/Invoke trampolines are used instead. Agent-Logs-Url: https://github.com/winnerspiros/osu/sessions/900d2a81-5771-4a37-ab0c-f6d9bf79386e Co-authored-by: winnerspiros <1675249+winnerspiros@users.noreply.github.com>
1 parent 92bb4b0 commit 857ebc5

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

osu.Android.props

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,14 @@
1313
<!-- NullabilityInfoContextSupport is disabled by default for Android -->
1414
<NullabilityInfoContextSupport>true</NullabilityInfoContextSupport>
1515
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
16-
<!-- Enable optimized marshal methods for faster managed↔native interop.
17-
.NET 10 generates efficient bridging code at build time instead of the
18-
slower runtime-generated trampolines. -->
19-
<AndroidEnableMarshalMethods>true</AndroidEnableMarshalMethods>
16+
<!-- Do NOT enable AndroidEnableMarshalMethods on .NET 10 with profiled AOT + trimming.
17+
The build-time P/Invoke stub generator can produce stubs that crash in native code
18+
when combined with partial AOT and trimmed assemblies — the crash bypasses managed
19+
exception handling entirely, resulting in silent SIGSEGV/SIGABRT with no crash logs.
20+
This is especially dangerous for apps with complex interop (UnmanagedCallersOnly,
21+
unmanaged function pointers, reflection-based handle discovery).
22+
The default runtime-generated trampolines are slower but proven reliable. -->
23+
<AndroidEnableMarshalMethods>false</AndroidEnableMarshalMethods>
2024
<!-- Suppress XA0141 page-size warnings. ELF patching is disabled for all configurations
2125
(see PatchElfPageSizeEnabled below) to prevent APK signature corruption.
2226
The XA0141 warning is therefore expected and harmless.

0 commit comments

Comments
 (0)