You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Mono.Android] update more TypeManager.GetClassName() calls (#9865)
Context: #9846
`Mono.Android` has various test failures under NativeAOT such as:
I NUnit : CastJavaLangObjectArrayToByteArrayThrows
E NUnit : [FAIL]
E NUnit : : Expected: <System.InvalidCastException>
E NUnit : But was: <System.DllNotFoundException> (DllNotFound_Linux, xa-internal-api,
E NUnit : dlopen failed: library "xa-internal-api.so" not found
E NUnit : dlopen failed: library "libxa-internal-api.so" not found
E NUnit : dlopen failed: library "xa-internal-api" not found
E NUnit : dlopen failed: library "libxa-internal-api" not found
E NUnit : )
E NUnit : at System.Runtime.InteropServices.NativeLibrary.LoadLibErrorTracker.Throw(String) + 0x4c
E NUnit : at Internal.Runtime.CompilerHelpers.InteropHelpers.FixupModuleCell(InteropHelpers.ModuleFixupCell*) + 0x134
E NUnit : at Internal.Runtime.CompilerHelpers.InteropHelpers.ResolvePInvokeSlow(InteropHelpers.MethodFixupCell*) + 0x40
E NUnit : at Android.Runtime.RuntimeNativeMethods.monodroid_TypeManager_get_java_class_name(IntPtr klass) + 0x2c
E NUnit : at Java.Interop.TypeManager.GetClassName(IntPtr) + 0x10
E NUnit : at Android.Runtime.JNIEnv.AssertCompatibleArrayTypes(IntPtr, Type) + 0x58
E NUnit : at Android.Runtime.JNIEnv.GetArray[T](IntPtr array_ptr) + 0x24
E NUnit : at Java.LangTests.ObjectArrayMarshaling.<>c__DisplayClass0_0.<CastJavaLangObjectArrayToByteArrayThrows>b__0() + 0x18
E NUnit : at NUnit.Framework.Assert.Throws(IResolveConstraint, TestDelegate, String, Object[]) + 0xc4
E NUnit : at Java.LangTests.ObjectArrayMarshaling.CastJavaLangObjectArrayToByteArrayThrows() + 0x150
E NUnit : at libMono.Android.NET-Tests!<BaseAddress>+0x152f704
E NUnit : at System.Reflection.DynamicInvokeInfo.Invoke(Object, IntPtr, Object[], BinderBundle, Boolean) + 0x10c
I updated the remaining calls in `JNIEnv.cs` to use
`JniEnvironment.Types.GetJniTypeNameFromClass()` instead.
$"Could not find constructor JNI signature '{jniCtorSignature}' on type '{Java.Interop.TypeManager.GetClassName(lrefClass)}'."));
208
+
$"Could not find constructor JNI signature '{jniCtorSignature}' on type '{JniEnvironment.Types.GetJniTypeNameFromClass(newJniObjectReference(lrefClass))}'."));
$"Could not find constructor JNI signature '{signature}' on type '{Java.Interop.TypeManager.GetClassName(jniClass)}'."));
226
+
$"Could not find constructor JNI signature '{signature}' on type '{JniEnvironment.Types.GetJniTypeNameFromClass(newJniObjectReference(jniClass))}'."));
$"Unable to cast from '{Java.Interop.TypeManager.GetClassName(grefSource)}' to '{Java.Interop.TypeManager.GetClassName(lrefDest)}'."));
546
+
$"Unable to cast from '{JniEnvironment.Types.GetJniTypeNameFromClass(newJniObjectReference(grefSource))}' to '{JniEnvironment.Types.GetJniTypeNameFromClass(newJniObjectReference(lrefDest))}'."));
$"Unable to cast from '{Java.Interop.TypeManager.GetClassName(lrefSource)}' to '{Java.Interop.TypeManager.GetClassName(grefDest)}'."));
561
+
$"Unable to cast from '{JniEnvironment.Types.GetJniTypeNameFromClass(newJniObjectReference(lrefSource))}' to '{JniEnvironment.Types.GetJniTypeNameFromClass(newJniObjectReference(grefDest))}'."));
562
562
}
563
563
}finally{
564
564
DeleteGlobalRef(grefDest);
@@ -1167,7 +1167,7 @@ public static IntPtr NewObjectArray<T>(params T[]? values)
0 commit comments