Problem with creating a new binding library


I'm trying to create a binding for mood stocks augmented reality library. I've hit a problem though with the binding which I'm not sure on how to fix.

The error is that you cannot compare an int to System.Type.

This is fair enough - question is how do I fix this bug?

The sort of method that is throwing the issue is like this

public virtual unsafe string Value
            // Metadata.xml XPath method reference: path="/api/package[@name='']/class[@name='Result']/method[@name='getValue' and count(parameter)=0]"
            [Register ("getValue", "()Ljava/lang/String;", "GetGetValueHandler")]
                if (id_getValue == IntPtr.Zero)
                    id_getValue = JNIEnv.GetMethodID(class_ref, "getValue", "()Ljava/lang/String;");

                    if (GetType() == ThresholdType)
                        return JNIEnv.GetString(JNIEnv.CallObjectMethod(Handle, id_getValue), JniHandleOwnership.TransferLocalRef);
                        return JNIEnv.GetString(JNIEnv.CallNonvirtualObjectMethod(Handle, ThresholdClass, JNIEnv.GetMethodID(ThresholdClass, "getValue", "()Ljava/lang/String;")), JniHandleOwnership.TransferLocalRef);

And the definition for ThresholdType is

protected override global::System.Type ThresholdType
            get { return typeof(Result); }

        protected Result(IntPtr javaReference, JniHandleOwnership transfer)
            : base(javaReference, transfer)





  • PaulJohnson.0531PaulJohnson.0531 GBMember ✭✭

    I've managed to get the bindings to build with the following meta info

        <attr path="/api/package[@name='']/class[@name='CameraFrame']/constructor[@name='CameraFrame' and count(parameter)=4 and parameter[1][@type=''] and parameter[2][@type='byte[]'] and parameter[3][@type=''] and parameter[4][@type='int']]" name="visibility">public</attr>
        <attr path="/api/package[@name='']/class[@name='Result']/method[@name='getType' and count(parameter)=0]" name="managedName">GetObjType</attr>

    Problem is that when I come to build I'm getting the two interfaces the above metadata fixes are defined as protected.

    Any clues as to solving this as it looks like something isn't binding correctly.

Sign In or Register to comment.