Repository navigation
[Java.Interop] Remove support for experimental JavaInterop1 codegen #11727
Description
Goal
Remove the experimental JavaInterop1 code-generation target and its runtime support, while preserving supported XAJavaInterop1 C# binding generation and the trimmable typemap's separate Java-generation pipeline.
Status
Completed by the merged cleanup series, verified against main at 44d713f364 on October 21, 2026:
- Migrate the supported NativeAOT consumer and GC bridge: #12133.
- Remove experimental
CodeGenerationTarget.JavaInterop1, its CLI/configuration branches and target-specific baselines,ManagedPeer,ManagedPeerNativeRegistration,GCUserPeerable, handwritten Java.Interop proxies, andjava-interop.jar: #13030. - Collapse C# binding generation to the supported
XAJavaInterop1backend: #13056. - Simplify the then-remaining JCW style (#13060), then retire the obsolete legacy JCW emitter,
JavaPeerStyleselection, standalonejcw-gen, and associated scaffolding (#13080). The supported trimmable typemap Java pipeline remains. - Keep explicit SDK errors for retired
AndroidCodegenTarget/_AndroidJcwCodegenTargetvalues, and retain the Android managed-object and exception transport paths.
Important scope distinction
The two retired JavaInterop1 switches controlled different things:
CodeGenerationTarget.JavaInterop1selected a generated C# binding shape.JavaPeerStyle.JavaInterop1selected the old Java Callable Wrapper emitter style.
The trimmable typemap consumes neither selector. It generates its own Java sources and registers natives through TrimmableTypeMap.RegisterNativeMethods() and mono.android.Runtime.registerNatives(Class). Removing the old Java emitter does not remove supported XAJavaInterop1 C# binding generation.
Historical plan and retained behavior
The earlier plan first decoupled the built-in handwritten proxies from ManagedPeer (#12152) and proposed retaining their standalone/JVM behavior. That intermediate plan was superseded by #13030, which retired those unsupported proxies along with the bridge. Do not implement the old lazy-registration plan or preserve the retired standalone proxy contract.
Current Android managed-object transport uses the trimmable object proxy with Java identity semantics; exception transport uses Android.Runtime.JavaProxyThrowable. Regression coverage remains in the Android device suite and TrimmableTypeMapBuildTests, including proxy packaging checks. This is a reconciliation of merged work, not a claim of a new test run.
Compatibility decision
Do not retain a runtime ManagedPeer compatibility shim. Previously generated or handwritten Java bytecode referencing net.dot.jni.ManagedPeer must migrate off that retired bridge.
The optional actionable build-time diagnostic mentioned in #11635 is not implemented by this cleanup; keep that follow-up question separate from the completed code-generation retirement. The broader dependency, packaging, documentation, and separate API-deprecation audits remain tracked by #11843.
Activity
[-][Java.Interop] Remove support for experimental `JavaInterop1` AndroidCodegenTarget[/-][+][Java.Interop] Remove support for experimental `JavaInterop1` AndroidCodegenTarget and JavaPeerStyle[/+][-][Java.Interop] Remove support for experimental `JavaInterop1` AndroidCodegenTarget and JavaPeerStyle[/-][+][Java.Interop] Remove support for experimental `JavaInterop1` AndroidCodegenTarget, _AndroidJcwCodegenTarget, and JavaPeerStyle[/+][-][Java.Interop] Remove support for experimental `JavaInterop1` AndroidCodegenTarget, _AndroidJcwCodegenTarget, and JavaPeerStyle[/-][+][Java.Interop] Remove support for experimental `JavaInterop1` codegen[/+][Java.Interop] Decouple built-in proxies from ManagedPeer (#12152)
[Java.Interop] Retire experimental JavaInterop1 support
[Java.Interop] Retire experimental JavaInterop1 support
[Java.Interop] Retire experimental JavaInterop1 support (#13030)