I have a Xamarin Android binding error that makes no sense!
The generated class stubs are:
[global::Android.Runtime.Register ("com/scichart/drawing/common/IRenderSurface", DoNotGenerateAcw=true)]
internal class IRenderSurfaceInvoker : global::Java.Lang.Object, IRenderSurface
[Register ("com/scichart/drawing/common/IRenderSurface", "", "Com.Scichart.Drawing.Common.IRenderSurfaceInvoker")]
public partial interface IRenderSurface : global::Com.Scichart.Core.Framework.IInvalidatableElement, global::Com.Scichart.Core.Framework.IView { }
// Metadata.xml XPath interface reference: path="/api/package[@name='com.scichart.core.framework']/interface[@name='IView']"
[Register ("com/scichart/core/framework/IView", "", "Com.Scichart.Core.Framework.IViewInvoker")]
public partial interface IView : global::Com.Scichart.Core.Framework.IContextProvider, global::Com.Scichart.Core.Framework.IHitTestable
{
int Visibility
{
// Metadata.xml XPath method reference: path="/api/package[@name='com.scichart.core.framework']/interface[@name='IView']/method[@name='getVisibility' and count(parameter)=0]"
[Register ("getVisibility", "()I", "GetGetVisibilityHandler:Com.Scichart.Core.Framework.IViewInvoker, SciChart.Android.Core")] get;
// Metadata.xml XPath method reference: path="/api/package[@name='com.scichart.core.framework']/interface[@name='IView']/method[@name='setVisibility' and count(parameter)=1 and parameter[1][@type='int']]"
[Register ("setVisibility", "(I)V", "GetSetVisibility_IHandler:Com.Scichart.Core.Framework.IViewInvoker, SciChart.Android.Core")] set;
}
}
What's happening is IView.Visibility (which has get, set) is conflicting with a base class Android.View.Visibility. I've worked around the conflict in additions folder but there is this IRenderSurfaceInvoker class which is generated, and not partial, and isn't implementing the IView interface properly.
Normally I'd ignore the property in metadata.xml and create it manually in a partial class, but that isn't possible as IRenderSurfaceInvoker is not partial.
What is a FooInvoker anyway??!
Any ideas? :)
EDIT: UPDATE
After Sven-Michael Stube's answer below, I have this partial solution:
<!-- In EnumMethods.xml -->
<mapping jni-interface="com/scichart/core/framework/IView">
<method jni-name="getVisibility" parameter="return" clr-enum-type="Android.Views.ViewStates" />
<method jni-name="setVisibility" parameter="visibility" clr-enum-type="Android.Views.ViewStates" />
</mapping>
But this results in the IView interface being generated as follows:
global::Android.Views.ViewStates Visibility {
// Metadata.xml XPath method reference: path="/api/package[@name='com.scichart.core.framework']/interface[@name='IView']/method[@name='getVisibility' and count(parameter)=0]"
[Register ("getVisibility", "()I", "GetGetVisibilityHandler:Com.Scichart.Core.Framework.IViewInvoker, SciChart.Android.Core")] get;
}
and the warning output
<attr path="/api/package[@name='com.scichart.core.framework']/interface[@name='IView']/method[@name='setVisibility']/parameter[@name='visibility']"/> matched no nodes
In other words, the EnumMethods.xml declaration above deletes the setter as it cannot find a match.
How can I debug this?
