Remove experimental AndroidGenerateJniMarshalMethods feature - #11128
Merged
jonathanpeppers merged 4 commits intoApr 16, 2026
Merged
Conversation
The AndroidGenerateJniMarshalMethods feature was experimental and completely broken (the target just emitted an error). Remove all code checking for the property, the _GenerateJniMarshalMethods target, the ResolveJdkJvmPath task (only used by this feature), and the related JNI marshal method extension methods. The property can still be set in project files but will have no effect. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes the long-broken experimental $(AndroidGenerateJniMarshalMethods) feature and its associated MSBuild targets/tasks, leaving the property as a no-op for backwards compatibility.
Changes:
- Removed the
_GenerateJniMarshalMethodsMSBuild target and all build/task wiring that supportedAndroidGenerateJniMarshalMethods. - Deleted the
ResolveJdkJvmPathMSBuild task and removed its usage fromXamarin.Android.Tooling.targets. - Simplified linker preservation logic and updated documentation/message-prefix index to reflect the feature removal in .NET 11.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Xamarin.Android.Build.Tasks/Xamarin.Android.Tooling.targets | Removes ResolveJdkJvmPath task registration/invocation and updates header comment. |
| src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets | Removes the feature property default/cache entry and drops _GenerateJniMarshalMethods from build dependencies. |
| src/Xamarin.Android.Build.Tasks/Tasks/ResolveJdkJvmPath.cs | Deletes the task used exclusively by the removed feature. |
| src/Xamarin.Android.Build.Tasks/Linker/MonoDroid.Tuner/Extensions.cs | Removes JNI marshal-method-related extension helpers now unused. |
| src/Microsoft.Android.Sdk.ILLink/PreserveRegistrations.cs | Removes marshal-method preservation path; preserves only registered methods. |
| Documentation/docs-mobile/messages/index.md | Removes the RJJ task prefix entry. |
| Documentation/docs-mobile/building-apps/build-properties.md | Updates docs to state the feature was removed in .NET 11 and is now a no-op. |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
jonathanpeppers
deleted the
jonathanpeppers/dev-peppers-remove-jni-marshal-methods
branch
April 16, 2026 17:58
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Description
The
$(AndroidGenerateJniMarshalMethods)property was an experimental feature that has been completely broken for a long time -- the MSBuild target just emitted an error:This PR removes all the dead code associated with this feature. If someone still sets the property in their project file, it simply does nothing.
Changes
_GenerateJniMarshalMethodstarget and its reference from_LinkAssembliesdependenciesXamarin.Android.Common.targetsResolveJdkJvmPath.cs-- an MSBuild task that only existed for this featureResolveJdkJvmPathUsingTask and invocation fromXamarin.Android.Tooling.targetsPreserveRegistrations.csby removingPreserveJniMarshalMethods()and the marshal method preservation logicExtensions.cs(GetMarshalMethodsType,TryGetBaseOrInterfaceRegisterMember,IsEqual,TryGetMarshalMethod,GetMarshalMethodName)RJJtask prefix from the messages indexChecklist