在Xamarin.Android中绑定.AAR时出错

时间:2016-04-16 17:17:32

标签: android binding xamarin xamarin.android aar

我试图绑定核心库:https://github.com/gabrielemariotti/cardslib

我从Maven Central下载了.AAR文件并完成了本教程中的所有内容绑定.AAR,但是当我构建绑定库时,我发现了这个错误:

'CardExpandableListAdapter' does not implement inherited abstract member 'BaseExpandableListAdapter.GetGroup(int)'
Inconsistent accessibility: return type 'CardWithList.LinearListAdapter' is less accessible than method 'CardWithList.GetLinearListAdapter()'
Inconsistent accessibility: parameter type 'CardWithList.LinearListAdapter' is less accessible than method 'CardWithList.SetLinearListAdapter(CardWithList.LinearListAdapter)'
Inconsistent accessibility: property type 'CardWithList.LinearListAdapter' is less accessible than property 'LinearListView.Adapter'
'CardView' does not implement interface member 'ICardViewWrapper.SetExpanded(bool)'
'CardView' does not implement interface member 'ICardViewWrapper.SetForceReplaceInnerLayout(bool)'
'CardView' does not implement interface member 'ICardViewWrapper.SetLongClickable(bool)'
'CardView' does not implement interface member 'ICardViewWrapper.SetOnExpandListAnimatorListener(ICardViewWrapperOnExpandListAnimatorListener)'
'CardView' does not implement interface member 'ICardViewWrapper.SetRecycle(bool)'

看起来绑定生成器有一些错误,是否有任何修复? 提前谢谢。

1 个答案:

答案 0 :(得分:2)

来自Xamarin的页面,

  

生成Java绑定时,可能会遇到几种常见的错误情况。

以下是您可能遇到的错误link以及如何解决这些错误。

Link关于如何修复"接口没有实现方法"

通过相应地更改可见性,可以解决不一致的可访问性问题。以下是如何修改可见性的示例

<attr path="/api/package[@name='com.somepackage']/class[@name='SomeClass']" name="visibility">public</attr>