Skip to content

Commit effc01e

Browse files
authored
Merge pull request #204 from winnerspiros/copilot/fix-osu-apk-crash
Disable AndroidEnableMarshalMethods to fix silent startup crash
2 parents 92bb4b0 + 857ebc5 commit effc01e

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)