Forum Xamarin.Android
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Binding Jar file failes because java.lang.object is not mapped to correct namespace

crecre USUniversity ✭✭

I get the following error when trying to bind a jar file:
The type or namespace name 'Lang' does not exist in the namespace 'Org.Hsqldb.Lib.Java' (are you missing an assembly reference?)

When looking into the generated code, the error seems to be the mapping of java.lang.object:

[Register ("heap")] protected IList<Java.Lang.Object> Heap { get { if (heap_jfieldId == IntPtr.Zero) heap_jfieldId = JNIEnv.GetFieldID (class_ref, "heap", "[Ljava/lang/Object;"); return JavaArray<global::Java.Lang.Object>.FromJniHandle (JNIEnv.GetObjectField (Handle, heap_jfieldId), JniHandleOwnership.TransferLocalRef); } set { if (heap_jfieldId == IntPtr.Zero) heap_jfieldId = JNIEnv.GetFieldID (class_ref, "heap", "[Ljava/lang/Object;"); IntPtr native_value = JavaArray<global::Java.Lang.Object>.ToLocalJniHandle (value); JNIEnv.SetField (Handle, heap_jfieldId, native_value); JNIEnv.DeleteLocalRef (native_value); } }

The generic type is Java.Lang.Object instead of global::Java.Lang.Object. All other uses of java.lang.object are mapped correctly.
Can I fix this with the Metadata.xml or is this an error in the binding process?

Tagged:
Sign In or Register to comment.