Trimmable typemap fails Java.Interop value-manager CreateValue contract test
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 62/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- android, csharp
- Domain
- mobile-dev, testing
Research direction
Start with external/Java.Interop/tests/Java.Interop-Tests/Java.Interop/JniRuntime.JniValueManagerTests.cs and the CreateValue test, then inspect the trimmable typemap value-manager path named in the failure. Reproduce using the listed project files and _AndroidTypeMapImplementation=trimmable. Done means CreateValue passes while the other four restored tests and non-trimmable coverage remain passing.
Written by the indexing model from the issue text.
Description
Android framework version
net11.0-android (Preview)
Affected platform version
.NET 11 Preview 7, CoreCLR with _AndroidTypeMapImplementation=trimmable
Description
Restoring Java.InteropTests.JniRuntimeJniValueManagerTests device-test coverage shows that four of its five tests pass under the trimmable typemap. CreateValue fails because its test ReflectionJniValueManager delegates marshaler lookup to the current runtime value manager, and TrimmableTypeMapValueManager.GetValueMarshalerCore(Type) throws NotSupportedException.
Expected: either the test's reflection value manager can resolve the IJavaPeerable marshaler under the trimmable typemap, or the test can be adapted to exercise supported trimmable behavior.
Actual: the test fails with GetValueMarshalerCore should not be called in the trimmable typemap path.
This is the only failing method in the restored fixture; GetValue_ReturnsAlias, GetValue_ReturnsNullWithInvalidSafeHandle, GetValue_ReturnsNullWithNullHandle, and PeekValue pass.
Steps to Reproduce
- Include
external/Java.Interop/tests/Java.Interop-Tests/Java.Interop/JniRuntime.JniValueManagerTests.csinJava.Interop-Tests.NET.csproj. - Build and install
tests/Mono.Android-Tests/Mono.Android-Tests/Mono.Android.NET-Tests.csprojwith-p:UseMonoRuntime=false -p:_AndroidTypeMapImplementation=trimmable. - Run the on-device test suite.
- Observe
Java.InteropTests.JniRuntimeJniValueManagerTests.CreateValuefail.
Did you find any workaround?
Exclude only Java.InteropTests.JniRuntimeJniValueManagerTests.CreateValue by fully-qualified NUnit test name when RuntimeFeature.TrimmableTypeMap is enabled. This retains the other four tests and all non-trimmable runtime coverage.
Relevant log output
System.NotSupportedException : GetValueMarshalerCore should not be called in the trimmable typemap path.
at Microsoft.Android.Runtime.TrimmableTypeMapValueManager.GetValueMarshalerCore(Type type)
at Java.Interop.JniRuntime.JniValueManager.GetValueMarshaler(Type type)
at Java.Interop.JavaPeerableValueMarshaler.CreateGenericValue(...)
at Java.Interop.JniRuntime.ReflectionJniValueManager.CreateValueCore(...)
at Java.InteropTests.JniRuntimeJniValueManagerTests.CreateValue()
- Dominant language
- C#
- Stars
- 2.1k
- Forks
- 580
- Avg merge
- 2d 19m
- Merged PRs (30d)
- 228
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dotnet/android
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Area: Debugger enhancement needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
Area: Mono.Android
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
agentic-workflows needs-triage
-
automated needs-triage skill-runner
Difficulty 5/5 Over a week Newbie friendliness 10/100
Similar issues
-
priority-0
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
StackExchange/StackExchange.Redis#3249 ·
-
[Feat] 조합 영역 구분선 개선 Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100