Bump external/Java.Interop from 8d54473 to 6ec1345#11782
Merged
jonathanpeppers merged 5 commits intoJul 1, 2026
Conversation
Bumps [external/Java.Interop](https://github.com/dotnet/java-interop) from `8d54473` to `6ec1345`. - [Commits](dotnet/java-interop@8d54473...6ec1345) --- updated-dependencies: - dependency-name: external/Java.Interop dependency-version: 6ec1345165fa7385c935f16ccaa8cc38be50a080 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com>
7049364 to 6ec13458d54473 to 6ec1345
99a23fc to
b0ce0ea
Compare
The Java.Runtime.Environment project was removed upstream in dotnet/java-interop#1447 (commit 4e142449), so the reference in Xamarin.Android.sln no longer resolves and breaks restore. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Member
|
The 6 vs 4 warning delta on
(Each warning is reported twice — once per configuration — hence 2 new × 2 = 4 added on top of the preexisting Suggested fixIn
|
…rNatives Upstream dotnet/java-interop#1474 added [RequiresDynamicCode] to the JniNativeMethodRegistration[] overload of JniEnvironment.Types.RegisterNatives, which makes ManagedTypeManager.RegisterNativeMembers emit IL3050 under NativeAOT. Marshal directly into blittable JniNativeMethod values (UTF-8 strings via Marshal.StringToCoTaskMemUTF8 + Marshal.GetFunctionPointerForDelegate) and call the blittable RegisterNatives(JniObjectReference, ReadOnlySpan<JniNativeMethod>) overload to eliminate the warning. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Upstream dotnet/java-interop#1474 added [RequiresDynamicCode] to: - JniRuntime.ReflectionJniTypeManager (the class), surfacing IL3050 at ManagedTypeManager..ctor() since we derive from it. - JniEnvironment.Types.RegisterNatives(.., JniNativeMethodRegistration[], int), surfacing IL3050 at ManagedTypeManager.RegisterNativeMembers. Suppress both for now; the JniNativeMethodRegistration[] registration path will be migrated to the blittable RegisterNatives(JniObjectReference, ReadOnlySpan<JniNativeMethod>) overload in a future change. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The ReflectionJniTypeManager [RequiresDynamicCode] attribute predates this submodule bump (added in dotnet/java-interop#1441), so the ManagedTypeManager..ctor() IL3050 is already part of the BuildHasNoWarnings test's baseline of 4 warnings. Only the RegisterNativeMembers warning is new from this PR; suppressing the ctor warning too would drop the count to 2 and fail the test. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
jonathanpeppers
approved these changes
Jun 30, 2026
simonrozsival
approved these changes
Jul 1, 2026
jonathanpeppers
added a commit
that referenced
this pull request
Jul 6, 2026
…veMembers 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>
jonathanpeppers
added a commit
that referenced
this pull request
Jul 6, 2026
) ### 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bumps external/Java.Interop from
8d54473to6ec1345.Commits
6ec1345Bump to dotnet/android-tools@bcce35f (#1485)4e14244Remove Java.Runtime.Environment and keep Java.Interop tests running (#1447)d6951e4[Xamarin.Android.Tools.Bytecode] Support JSpecify nullness annotations (#1483)204d731Register JNI natives via blittable JniNativeMethod (#1474)b5741ec[tests] Share + shrink api-24.xml.in fixture (#1484)57a9129[ci] Bump hosted pool images to windows-2025 / macOS-15 (#1482)