Commit a2d46b3
[release/11.0.1xx-preview6] Bump to dotnet/java-interop@c24a8e9b (#11997)
### 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
### [Mono.Android] Suppress new IL3050 in ManagedTypeManager.RegisterNativeMembers
dotnet/java-interop#1474 (pulled in by the Java.Interop bump in this PR)
adds [RequiresDynamicCode] to
JniEnvironment.Types.RegisterNatives(.., JniNativeMethodRegistration[], int),
surfacing a new IL3050 AOT analysis warning at
ManagedTypeManager.RegisterNativeMembers under NativeAOT. That broke
BuildHasNoWarnings(True,False,"apk",NativeAOT), which asserts an exact
warning count.
Suppress for now; the JniNativeMethodRegistration[] registration path will
be migrated to the blittable RegisterNatives(JniObjectReference,
ReadOnlySpan<JniNativeMethod>) overload in a future change. Mirrors the
companion change made on main in #11782.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>1 parent 2114bc8 commit a2d46b3
2 files changed
Lines changed: 2 additions & 1 deletion
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
| |||
0 commit comments