Skip to content
This repository was archived by the owner on Aug 27, 2026. It is now read-only.
This repository was archived by the owner on Aug 27, 2026. It is now read-only.

Add [Category("NativeAOTIgnore")] to JNI method remapping tests #1388

Description

@jonathanpeppers

When running Java.Interop-Tests on NativeAOT in dotnet/android (PR dotnet/android#10496), the JNI method remapping tests fail because NativeAOT does not have _monodroid_lookup_replacement_method_info / _monodroid_lookup_replacement_type native functions, and we do not plan to implement them.

These 4 tests should be marked with [Category("NativeAOTIgnore")] so they are excluded when $(PublishAot)==true:

  • JniPeerMembersTests.ReplaceInstanceMethodName
  • JniPeerMembersTests.ReplaceStaticMethodName
  • JniPeerMembersTests.ReplaceInstanceMethodWithStaticMethod
  • JniPeerMembersTests.ReplacementTypeUsedForMethodLookup

The dotnet/android test runner already excludes the NativeAOTIgnore category when building with NativeAOT.

All 4 tests fail with Java.Lang.NoSuchMethodError because the method replacement/remapping infrastructure (GetReplacementMethodInfoCore, GetReplacementTypeCore) relies on native functions that are only available on Mono/CoreCLR via AndroidTypeManager, not on NativeAOT via ManagedTypeManager.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions