Bug 40041 - Error CS0102: The type abc already contains a definition for yyy (CS0102) (AndroidBinding)
Summary: Error CS0102: The type abc already contains a definition for yyy (CS0102) (An...
Alias: None
Product: Android
Classification: Xamarin
Component: Bindings ()
Version: unspecified
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Atsushi Eno
Depends on:
Reported: 2016-04-01 08:49 UTC by Le Huu Hoang Gia
Modified: 2016-04-01 12:57 UTC (History)
1 user (show)

Is this bug a regression?: ---
Last known good build:

wechat library (151.33 KB, application/java-archive)
2016-04-01 08:49 UTC, Le Huu Hoang Gia

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Le Huu Hoang Gia 2016-04-01 08:49:43 UTC
Created attachment 15584 [details]
wechat library

I'm using xamarin to have a POC project tells that we could integrate wechat sdk into xamarin using android library in attachment or we can easily download via http://dev.wechat.com/wechatapi/download

Following tutorials, I'm having these issues:
AndroidBinding/obj/Release/generated/src/Com.Tencent.MM.Sdk.Openapi.BaseResp.cs(25,25): Error CS0102: The type `Com.Tencent.MM.Sdk.Openapi.BaseResp' already contains a definition for `ErrCode' (CS0102) (AndroidBinding)
AndroidBinding/obj/Release/generated/src/Com.Tencent.MM.Sdk.Openapi.WXMediaMessage.cs(25,25): Error CS0102: The type `Com.Tencent.MM.Sdk.Openapi.WXMediaMessage' already contains a definition for `MediaObject' (CS0102) (AndroidBinding)

Here is the content of Metadata.xml:

  <attr path="/api/package[@name='com.tencent.mm.sdk.openapi']/class[@name='BaseResp']/field[@name='errCode']" name="errCode">PropErrCode</attr>
  <attr path="/api/package[@name='com.tencent.mm.sdk.openapi']/class[@name='WXMediaMessage']/field[@name='mediaObject']" name="fMediaObject">FMediaObject</attr>

I would like to rename these property to get rids of the build errors with no luck. Please help.
Comment 1 Atsushi Eno 2016-04-01 12:57:53 UTC
In your <attr> element, the value of 'name' attribute should be the name in the Metadata.xml vocabulary and no need to specify the target field name there again. It should be "managedName" i.e.

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