iosduplicatessymbolssbjson

Duplicate Symbol Error: SBJsonParser.o?


I currently have ShareKit in my project that is compiled as a static library. It is properly implemented. I also have implemented Amazon's AWS SDK by just adding their framework into my project.

It seems that the duplicate symbol is coming from Amazon's AWS SDK file, "AWSIOSSDK". This is what it looks like:

enter image description here

And that file is colliding with ShareKit's file, libShareKit.a. This is what that file looks like:

enter image description here

Anyway both of these files are ones that I haven't seen before. And it seems that some JSON files are colliding within them.

I have looked at other SO questions and they say to do some things with the compiled sources but none of these files are in the compiled sources from either library.

Here is the exact error Xcode gives:

ld: duplicate symbol _OBJC_CLASS_$_SBJsonParser

Anyway, does anyone have any ideas what I should do? My app does not compile unless I fix this issue.

Thanks!


Solution

  • Both of these have built SBJsonParser into their static libraries. This is not the correct way to build a static library. Each should build without SBJson and then you should link all of them together with SBJson. There are a couple of solutions: