我有一个Xamarin Android绑定错误,没有任何意义!
生成的类存根是:
def block_params
params.require(:block).permit(:block_code, :block_duration, :cue_code, :location_code, :scene_code, :block_description, :cue_attributes => [:id, :cue_code, :cue_type_code, :cue_description, :cue_method_code], :block_block_attributes => [:id, :block_block_code, :primary_block_code, :secondary_block_code, :block_block_start], :block_character_attributes => [:id, :block_character_code, :character_code, :block_code, :character_action, :character_motivation])
end
正在发生的事情是IView.Visibility(已获取,设置)与基类Android.View.Visibility冲突。我已经解决了附加文件夹中的冲突,但是有一个生成的IRenderSurfaceInvoker类,而不是部分的,并且没有正确实现IView接口。
通常我会忽略metadata.xml中的属性并在分部类中手动创建它,但这不可能,因为IRenderSurfaceInvoker不是部分的。
反正什么是FooInvoker ??!
有什么想法吗? :)
编辑:更新
在Sven-Michael Stube的回答下面,我有这个部分解决方案:
[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;
}
}
但是这会导致IView接口生成如下:
<!-- 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>
和警告输出
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;
}
换句话说,上面的EnumMethods.xml声明删除了setter,因为它找不到匹配项。
我该如何调试?