Summary
The trimmable typemap (_AndroidTypeMapImplementation=trimmable) has 48 tests that are currently excluded because they fail due to fundamental trimmable-typemap limitations. They are excluded by exact name in NUnitInstrumentation.cs, guarded by RuntimeFeature.TrimmableTypeMap, so they only apply to trimmable builds.
The goal is to fix these one by one and remove each exclusion as it's resolved.
All failures share common root causes: the trimmable typemap does not generate Java-side classes for types in Java.Interop-Tests that use JavaObject (not Java.Lang.Object) or rely on net.dot.jni.test.* / net.dot.jni.internal.* Java classes, and some runtime behaviors differ (wrong exception types, missing proxy resolution, etc.).
How to reproduce
make prepare && make all CONFIGURATION=Release
./dotnet-local.sh build tests/Mono.Android-Tests/Mono.Android-Tests/Mono.Android.NET-Tests.csproj \
-t:RunTestApp -c Release \
-p:_AndroidTypeMapImplementation=trimmable \
-p:UseMonoRuntime=false
Results: 859 passed, 48 excluded, 10 ignored (by NativeTypeMap/Export/CoreCLRIgnore/NTLM — not trimmable-specific).
To see the raw failures, temporarily remove the ExcludedTestNames block from NUnitInstrumentation.cs.
❌ Missing Java classes (5 tests)
| Test(s) |
Count |
Missing Class |
Error |
JavaObjectTest.DisposeAccessesThis |
1 |
net.dot.jni.test.GetThis |
Cannot register native members |
InvokeVirtualFromConstructorTests.* |
3 |
net.dot.jni.test.CallVirtualFromConstructorDerived |
NoClassDefFoundError |
JniTypeManagerTests.CannotCreateGenericHolderFromJava |
1 |
net.dot.jni.test.GenericHolder |
Returns null instead of throwing NotSupportedException |
❌ JavaProxyObject / JavaProxyThrowable not available (24 tests)
| Test(s) |
Count |
Error |
JavaObjectArray_object_ContractTest.* |
16 |
TestFixtureSetUp Failed — JavaProxyObject native member registration fails |
JniValueMarshaler_object_ContractTests.* (Create*, SpecificTypesAreUsed) |
7 |
NoClassDefFoundError: net.dot.jni.internal.JavaProxyObject |
JavaExceptionTests.InnerExceptionIsNotAProxy |
1 |
Proxy throwable creation fails |
❌ Proxy resolution / trimmer gaps (4 tests)
| Test |
Error |
JniValueMarshaler_IJavaPeerable_ContractTests.*.CreateGenericValue |
No JavaPeerProxy for java/lang/Object with IJavaPeerable target |
JniValueMarshaler_IJavaPeerable_ContractTests.*.CreateValue |
No JavaPeerProxy for java/lang/Object with IJavaPeerable target |
JavaPeerableExtensionsTests.JavaAs |
MissingMethodException — IJavaInterfaceInvoker ctor trimmed |
JavaPeerableExtensionsTests.JavaAs_Exceptions |
Wrong exception type (ClassNotFoundException vs ArgumentException) |
JavaPeerableExtensionsTests.JavaAs_InstanceThatDoesNotImplementInterfaceReturnsNull |
No JavaPeerProxy for IAndroidInterface |
❌ JavaCast proxy resolution (4 tests)
| Test |
Error |
JavaObjectExtensionsTests.JavaCast_BadInterfaceCast |
NotSupportedException instead of InvalidCastException |
JavaObjectExtensionsTests.JavaCast_CheckForManagedSubclasses |
NotSupportedException instead of InvalidCastException |
JavaObjectExtensionsTests.JavaCast_InvalidTypeCastThrows |
NotSupportedException instead of InvalidCastException |
JavaObjectExtensionsTests.JavaCast_BaseToGenericWrapper |
Cannot create instance of open generic type |
❌ Open generic types / registration (4 tests)
| Test |
Error |
JnienvTest.NewOpenGenericTypeThrows |
Open generic creation succeeds when it should throw NotSupportedException |
JnienvTest.ActivatedDirectThrowableSubclassesShouldBeRegistered |
Throwable subclass not registered (Expected: True, But was: False) |
ObjectTest.GetObject_ReturnsMostDerivedType |
Returns Java.Lang.Object instead of Java.Lang.String |
ObjectTest.JnienvCreateInstance_RegistersMultipleInstances |
Instance identity differs after JNI round-trip |
❌ JNI method remapping not supported (4 tests)
| Test |
Error |
JniPeerMembersTests.ReplaceInstanceMethodName |
NoSuchMethodError — remapped method not found |
JniPeerMembersTests.ReplaceInstanceMethodWithStaticMethod |
NoSuchMethodError |
JniPeerMembersTests.ReplaceStaticMethodName |
NoSuchMethodError |
JniPeerMembersTests.ReplacementTypeUsedForMethodLookup |
Returns wrong hash code |
❌ Other (3 tests)
| Test |
Error |
JniTypeManagerTests.GetType |
InvalidOperationException — no JniPrimitiveArrayInfo for JavaBooleanArray |
CustomWidgetTests.InflateCustomView_ShouldNotLeakGlobalRefs |
256 extra global refs after inflating/GC'ing 100 custom views |
✅ Previously excluded, now (re)enabled (45 tests)
As of PR #11091, all over-broad exclusions were replaced with precise per-test exclusions. 45 tests that were previously silently excluded now run and pass:
GetObjectArray (was CoreCLRIgnore)
- 3 NTLM negotiate auth tests (were
NTLM category)
JavaExceptionTests.InnerException, StackTrace
JavaObjectExtensionsTests.JavaAs
- 11
JavaObjectTest tests (Ctor, Dispose, GC, registration, etc.)
JavaPeerableExtensionsTests.JavaAs_NullSelfReturnsNull
- 4
JniPeerMembersTests tests (Ctor, desugaring, fallback lookup, virtual invoke)
- 3
JniTypeManagerTests tests (CanCreateGenericHolder, GetTypeSignature×2)
- 16
JniValueMarshaler_IJavaPeerable_ContractTests tests
- 3
JniValueMarshaler_object_ContractTests tests
- 3
CustomWidgetTests inflate tests
Summary Table
| Root Cause |
Count |
Missing net.dot.jni.test.* Java classes |
5 |
JavaProxyObject/JavaProxyThrowable not available |
24 |
| Proxy resolution / trimmer gaps |
5 |
| JavaCast proxy resolution |
4 |
| Open generic types / registration |
4 |
| JNI method remapping |
4 |
| Other |
2 |
| Total excluded |
48 |
| Previously excluded, now (re)enabled |
45 |
Summary
The trimmable typemap (
_AndroidTypeMapImplementation=trimmable) has 48 tests that are currently excluded because they fail due to fundamental trimmable-typemap limitations. They are excluded by exact name inNUnitInstrumentation.cs, guarded byRuntimeFeature.TrimmableTypeMap, so they only apply to trimmable builds.The goal is to fix these one by one and remove each exclusion as it's resolved.
All failures share common root causes: the trimmable typemap does not generate Java-side classes for types in
Java.Interop-Teststhat useJavaObject(notJava.Lang.Object) or rely onnet.dot.jni.test.*/net.dot.jni.internal.*Java classes, and some runtime behaviors differ (wrong exception types, missing proxy resolution, etc.).How to reproduce
make prepare && make all CONFIGURATION=Release ./dotnet-local.sh build tests/Mono.Android-Tests/Mono.Android-Tests/Mono.Android.NET-Tests.csproj \ -t:RunTestApp -c Release \ -p:_AndroidTypeMapImplementation=trimmable \ -p:UseMonoRuntime=falseResults: 859 passed, 48 excluded, 10 ignored (by
NativeTypeMap/Export/CoreCLRIgnore/NTLM— not trimmable-specific).To see the raw failures, temporarily remove the
ExcludedTestNamesblock fromNUnitInstrumentation.cs.❌ Missing Java classes (5 tests)
JavaObjectTest.DisposeAccessesThisnet.dot.jni.test.GetThisInvokeVirtualFromConstructorTests.*net.dot.jni.test.CallVirtualFromConstructorDerivedNoClassDefFoundErrorJniTypeManagerTests.CannotCreateGenericHolderFromJavanet.dot.jni.test.GenericHoldernullinstead of throwingNotSupportedException❌
JavaProxyObject/JavaProxyThrowablenot available (24 tests)JavaObjectArray_object_ContractTest.*TestFixtureSetUp Failed—JavaProxyObjectnative member registration failsJniValueMarshaler_object_ContractTests.*(Create*, SpecificTypesAreUsed)NoClassDefFoundError: net.dot.jni.internal.JavaProxyObjectJavaExceptionTests.InnerExceptionIsNotAProxy❌ Proxy resolution / trimmer gaps (4 tests)
JniValueMarshaler_IJavaPeerable_ContractTests.*.CreateGenericValueJavaPeerProxyforjava/lang/ObjectwithIJavaPeerabletargetJniValueMarshaler_IJavaPeerable_ContractTests.*.CreateValueJavaPeerProxyforjava/lang/ObjectwithIJavaPeerabletargetJavaPeerableExtensionsTests.JavaAsMissingMethodException—IJavaInterfaceInvokerctor trimmedJavaPeerableExtensionsTests.JavaAs_ExceptionsClassNotFoundExceptionvsArgumentException)JavaPeerableExtensionsTests.JavaAs_InstanceThatDoesNotImplementInterfaceReturnsNullJavaPeerProxyforIAndroidInterface❌ JavaCast proxy resolution (4 tests)
JavaObjectExtensionsTests.JavaCast_BadInterfaceCastNotSupportedExceptioninstead ofInvalidCastExceptionJavaObjectExtensionsTests.JavaCast_CheckForManagedSubclassesNotSupportedExceptioninstead ofInvalidCastExceptionJavaObjectExtensionsTests.JavaCast_InvalidTypeCastThrowsNotSupportedExceptioninstead ofInvalidCastExceptionJavaObjectExtensionsTests.JavaCast_BaseToGenericWrapper❌ Open generic types / registration (4 tests)
JnienvTest.NewOpenGenericTypeThrowsNotSupportedExceptionJnienvTest.ActivatedDirectThrowableSubclassesShouldBeRegisteredExpected: True, But was: False)ObjectTest.GetObject_ReturnsMostDerivedTypeJava.Lang.Objectinstead ofJava.Lang.StringObjectTest.JnienvCreateInstance_RegistersMultipleInstances❌ JNI method remapping not supported (4 tests)
JniPeerMembersTests.ReplaceInstanceMethodNameNoSuchMethodError— remapped method not foundJniPeerMembersTests.ReplaceInstanceMethodWithStaticMethodNoSuchMethodErrorJniPeerMembersTests.ReplaceStaticMethodNameNoSuchMethodErrorJniPeerMembersTests.ReplacementTypeUsedForMethodLookup❌ Other (3 tests)
JniTypeManagerTests.GetTypeInvalidOperationException— noJniPrimitiveArrayInfoforJavaBooleanArrayCustomWidgetTests.InflateCustomView_ShouldNotLeakGlobalRefs✅ Previously excluded, now (re)enabled (45 tests)
As of PR #11091, all over-broad exclusions were replaced with precise per-test exclusions. 45 tests that were previously silently excluded now run and pass:
GetObjectArray(wasCoreCLRIgnore)NTLMcategory)JavaExceptionTests.InnerException,StackTraceJavaObjectExtensionsTests.JavaAsJavaObjectTesttests (Ctor, Dispose, GC, registration, etc.)JavaPeerableExtensionsTests.JavaAs_NullSelfReturnsNullJniPeerMembersTeststests (Ctor, desugaring, fallback lookup, virtual invoke)JniTypeManagerTeststests (CanCreateGenericHolder, GetTypeSignature×2)JniValueMarshaler_IJavaPeerable_ContractTeststestsJniValueMarshaler_object_ContractTeststestsCustomWidgetTestsinflate testsSummary Table
net.dot.jni.test.*Java classesJavaProxyObject/JavaProxyThrowablenot available