Skip to content

Commit c91c346

Browse files
Bump external/Java.Interop from 7049364 to c24a8e9b
Fixes a Release-mode startup crash in MAUI apps on preview.6: System.TypeInitializationException: ... Java.Interop.ManagedPeer ---> Java.Lang.IncompatibleClassChangeError: no static or non-static method "Lnet/dot/jni/ManagedPeer;.????" Picks up dotnet/java-interop#1474 "Register JNI natives via blittable JniNativeMethod", which reworks the RegisterNatives chokepoint to marshal method names/signatures to UTF-8 ourselves and dispatch through the blittable RegisterNatives(ReadOnlySpan<JniNativeMethod>) overload. The old path passed a non-blittable JniNativeMethodRegistration[] through a delegate* unmanaged<> call. dotnet/runtime#126911 moved array-of-struct marshalling into a managed StructureMarshaler<T> whose blittable-only fallback is miscompiled by crossgen2 under composite R2R + startup MIBC, blitting a managed string reference into the native char* name and corrupting the registered method names (the "????" above). This only reproduces in Release (composite R2R + PGO), which is why Debug and `dotnet new android` were unaffected while MAUI Release crashed. Refs: #11633 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 2114bc8 commit c91c346

1 file changed

Lines changed: 1 addition & 1 deletion

File tree