Native linking failed: duplicate symbols.

JigarMJigarM USMember ✭✭
edited May 2017 in Xamarin.iOS

Hello Folks,

I have one third party library which uses SDWebImage library and I want to import this library into my project and My project itself has same SDWebImage library.
When I test this third party library in the sample project, the library works like charm but while importing same library into the my project. It throws an error
"Native linking failed: duplicate symbols.".

Please guide me to solve this issue.

I followed below mentioned scenarions:
1. https://forums.xamarin.com/discussion/10315/native-linking-failed-duplicate-symbols-how-to-solve
2. https://bugzilla.xamarin.com/show_bug.cgi?id=34186

But I can't get any success regarding this.
Help will be appreciate.

Regards,
Jigar M

Answers

  • JohnMillerJohnMiller USForum Administrator, Xamarin Team Xamurai

    @JigarMaheshwari.5413,

    It's possible that some configuration is missing in your project vs. the sample. Can you compare the .csproj file and/or the iOS Build settings of your project? Look for any differences there, specifically in the Additional mtouch arguments area.

  • JGoldbergerJGoldberger USMember, Forum Administrator, Xamarin Team, University Xamurai

    @JigarMaheshwari.5413 said:
    Hello Folks,

    I have one third party library which uses SDWebImage library and I want to import this library into my project and My project itself has same SDWebImage library.

    If you are already referencing SDWebImage in your project, and then importing another library that references SDWebImage that would seem to be a cause for duplicate symbols. Can you remove the SDWebImage library from your project and juts use the one included with the third party library?

  • JigarMJigarM USMember ✭✭

    @JGoldberger

    Thank for the prompt response.
    I already tried to bind this library with sample project(sample project does not have SDWebImage) and It seems like works fine.

    But I need SDWebImage in My current project and also need in third party library too. Is it possible bind SDWebImage in both ends?

  • JigarMJigarM USMember ✭✭

    @JohnMiller said:
    @JigarMaheshwari.5413,

    It's possible that some configuration is missing in your project vs. the sample. Can you compare the .csproj file and/or the iOS Build settings of your project? Look for any differences there, specifically in the Additional mtouch arguments area.

    Sample project does not contain SDWebImage integration and in my current project I used SDWebImage. So I am thinking that is the main reason for duplicate symbol error.
    But I need SDWebImage in both sides.

    Is it possible?

    Additional mtouch arguments option in iOS Build Setting of sample project and my current project is Empty.

  • stpaulstpaul UAMember

    Can't you just reference the SDWebImage in your project/binding and not link it? That way you can use all the classes and methods from the library in your source code. And you get required symbols in the resulting binary from the version used by the 3rd party library.

Sign In or Register to comment.