我试图在Xamarin Mono上使用GameCircle SDK for android,但我遇到了这些问题:
Com.Amazon.Ags.Client.Whispersync.GameDataSingleMap.cs(23,23): Error CS0738:
`Com.Amazon.Ags.Client.Whispersync.GameDataSingleMap' does not implement interface member
`Com.Amazon.Ags.Client.Whispersync.Model.IMergeable.DeepCopy()'
and the best implementing candidate
`Com.Amazon.Ags.Client.Whispersync.GameDataSingleMap.DeepCopy()'
return type `Com.Amazon.Ags.Client.Whispersync.GameDataSingleMap'
does not match interface member return type `Java.Lang.Object' (CS0738) (GameCircle.MonoDroid)
Com.Amazon.Ags.Client.Whispersync.GameDataSingleMap.cs(23,23): Error CS0535:
`Com.Amazon.Ags.Client.Whispersync.GameDataSingleMap' does not implement interface member
`Com.Amazon.Ags.Client.Whispersync.Model.IMergeable.Merge(Java.Lang.Object)' (CS0535) (GameCircle.MonoDroid)
Com.Amazon.Ags.Client.Whispersync.Model.NumberList.cs(80,80): Error CS0103: The name `DeepCopy' does not exist in the current context (CS0103) (GameCircle.MonoDroid)
我已经在GitHub上创建了一个存储库,所以任何人都可以为它的工作做出贡献。
https://github.com/mapo80/GameCircle.MonoDroid
任何帮助?
谢谢!
答案 0 :(得分:1)
这是由于绑定生成器和Java协变返回类型的限制。修复方法是向managedReturn
添加Transforms\Metadata.xml
属性。
请参阅Binding a Java Library (.jar)文档中的问题:类未实现接口方法部分。
例如,您可以将此XML片段添加到Transforms\Metadata.xml
:
<attr
path="/api/package[@name='com.amazon.ags.client.whispersync']/class[@name='GameDataSingleMap']/method[@name='deepCopy']"
name="managedReturn"
>Java.Lang.Object</attr>