2

I'm trying to binding WeChat SDK into Xamarin using .jar file from WeChat SDK Downloads.

I had follow the tutorials from here. Unfortunately, I'm having these 2 issues when trying to rebuild the solutions:

  • Severity Code Description Project File Line Suppression State Error CS0102 The type 'BaseResp' already contains a definition for 'ErrCode'

  • Severity Code Description Project File Line Suppression State Error CS0102 The type 'WXMediaMessage' already contains a definition for 'MediaObject'

Can you guys give me some guidance please. Thanks in advance for help. :)

Wei Loon Wong
  • 450
  • 1
  • 7
  • 23
  • 1
    can you check BaseResp contains 2 property as ErrCode and also WXMediaMessage contains 2 property as MediaObject? if so please remove a entry. – Thennarasan Apr 28 '17 at 11:34

1 Answers1

1

I solved this by editing code of Metadata.xml inside folder Transforms.

Just add 2 lines of code. After this, clean and build your solutions:

<attr path="/api/package[@name='com.tencent.mm.sdk.modelbase']/class[@name='BaseResp']/field[@name='errCode']" name="managedName">errCode</attr>
<attr path="/api/package[@name='com.tencent.mm.sdk.modelmsg']/class[@name='WXMediaMessage']/field[@name='mediaObject']" name="managedName">mediaObject</attr>

Note: You can double-clicked on the errors to navigate you to the corresponding XPath field reference.

Image

For more information, read Java Bindings Metadata.

Wei Loon Wong
  • 450
  • 1
  • 7
  • 23