Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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.
I am having this error in my test iPhone app for my iOS Binding Project:
Error MT5212: Native linking failed, duplicate symbol: '_OBJC_METACLASS_$_AFJSONParser'. (MT5212) (AerisMap)
Error MT5213: Duplicate symbol in: /Users/danielknoodle/Documents/AerisMap/AerisMapTest/obj/iPhoneSimulator/Debug/mtouch-cache/Aeris.a(AFJSONParser+JSONKit.o) (Location related to previous error) (MT5213) (AerisMap)
Error MT5213: Duplicate symbol in: /Users/danielknoodle/Documents/AerisMap/AerisMapTest/obj/iPhoneSimulator/Debug/mtouch-cache/Aeris.a(AFJSONParser+SBJSON.o) (Location related to previous error) (MT5213) (AerisMap)
As we know, an obj.c file that has + sign works similar to a partial class in c#. (please correct me if i'm wrong). i wonder why AFJSONParser+JSONKit.o and AFJSONParser+SBJSON.o are treated as different classes.
Here is the documentation of the objective-c library that i need to bind. http://www.hamweather.com/support/documentation/mobile/
I have tried to reproduce this issue but i am not able to reproduce this.
Could you please attached sample application? So that we can reproduce this issue.
Created attachment 5744 [details]
Sample iOS Binding Project
Thank you for responding to my bug entry.
Please check the link to my sample project.
As you will see, there are no compilation errors in the iOS Binding Project.
The problem occurs when i use the resulting dll to the test project.
This is a problem with the native library, it wasn't built correctly (there are duplicated methods in it).
You can work around this by adding the following to all the LinkWith attributes in the binding project:
[assembly: LinkWith (..., SmartLink = true)]
and then add the following to the additional mtouch arguments in the iOS Build options of the main project:
Alternatively you can ask the vendor of the native library to provide a properly built library (this problem can be reproduced in an Xcode sample by disabling dead strip for the linker and adding -load_all as an extra linker flag).