【问题标题】:GameCircle - MonoDroid - XamarinGameCircle - MonoDroid - Xamarin
【发布时间】:2013-11-17 15:44:27
【问题描述】:

我正在尝试在 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

有什么帮助吗?

谢谢!!

【问题讨论】:

    标签: c# android xamarin.android amazon xamarin


    【解决方案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>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-11-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多