Problem with creating a new binding library

Hi,

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='com.moodstocks.android']/class[@name='Result']/method[@name='getValue' and count(parameter)=0]"
            [Register ("getValue", "()Ljava/lang/String;", "GetGetValueHandler")]
            get
            {
                if (id_getValue == IntPtr.Zero)
                    id_getValue = JNIEnv.GetMethodID(class_ref, "getValue", "()Ljava/lang/String;");
                try
                {

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

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)
        {
        }

Thanks

PFJ

Tagged:

Posts

  • PaulJohnson.0531PaulJohnson.0531 GBMember ✭✭

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

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

    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.