游戏圈- MonoDroid - Xamarin

y1aodyip  于 2023-03-21  发布在  其他
关注(0)|答案(1)|浏览(126)

我试图使用Xamarin Mono for Android上的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
有人帮忙吗?
谢谢!

dl5txlt9

dl5txlt91#

这是由于绑定生成器和Java协变返回类型的限制。修复方法是向Transforms\Metadata.xml添加一个managedReturn属性。
请参见问题:类未实现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>

相关问题