我正在尝试在Android的Xamarin Mono上使用GameCircle SDK,但存在以下问题:

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

有什么帮助吗?

谢谢!!

最佳答案

这是由于绑定生成器和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>

08-05 04:39