ShareKit / ShareKit

Drop in sharing features for all iPhone and iPad apps
2.19k stars 717 forks source link

Error with Duplicate jsonkit.o #391

Closed sangrime closed 11 years ago

sangrime commented 11 years ago

I try to add sharekit into an app with Cordova V 1.7

but can't compile with this error output:

Duplicate symbol _jk_collectionClassLoadTimeInitialization in /Users/Shared/Cordova/Frameworks/Cordova.framework/Cordova and /Users/sp/Library/Developer/Xcode/DerivedData/war-dxfmcxrysrhhujgqbwgymonstgpl/Build/Products/Debug-iphonesimulator/libShareKit.a(JSONKit.o) for architecture i386

Any way to solve it ?

VilemKurz commented 11 years ago

Probably you use JSONKit somewhere else within your project. Remove it from your project..

sangrime commented 11 years ago

Solved.

add Cordova header path into ShareKit's build setting to make it against with the jsonkit comes with cordova.

sangrime commented 11 years ago

Thanks for VilemKurz. I understand it was cause by JSONKit. But Cordova release as a binary. Cordova: Mach-O universal binary with 3 architectures Cordova (for architecture armv6): Mach-O object arm Cordova (for architecture armv7): Mach-O object arm Cordova (for architecture i386): Mach-O object i386

So, I make ShareKit link against it to solve this problem. Thanks for your time~

xor83 commented 11 years ago

hi sangrime,

If you able integrate sharekit in cordova using plugin can you share some code? its been 1 week and I am not able to do this.. created a plugin which calls sharekit action sheet and when I click to share on FB it authenticates and after that all gone ....

any help?

kerrishotts commented 11 years ago

For more detailed steps, this got me to the build point: 1) User Header Search Paths in Sharekit subproject set to /Users/Shared/Cordova/Frameworks/Cordova.framework/** 2) renamed JSONKit.h/.m to JSONKit.h.old/.m.old

There seriously needs to be a better way than this, though. :-(

VilemKurz commented 11 years ago

There is a target called "Static Library No Submodules" in ShareKit. It is only ShareKit files, without 3rd party code. You can use this one, and use JSONKit from Cordova. In this case do not forget to add the rest of ShareKit's submodules to your project by hand. This way you do not change any of ShareKit's files and you can update ShareKit flawlessly. If you decide to go this way, please provide feedback, if you'll have success.

wiinigo commented 11 years ago

Hello, I have the same problem and I can't make work it.

I put in ShareKit.xcodeproj>Build Settings>Search Paths:

But I have de same problem:

duplicate symbol _jk_collectionClassLoadTimeInitialization in /Users/Shared/Cordova/Frameworks/Cordova.framework/Cordova and /Users/usermac/Library/Developer/Xcode/DerivedData/share-dhzimfplucgzspgwzwhlhjhgunxk/Build/Products/Debug-iphonesimulator/libShareKit.a(JSONKit.o)

It seems that I don't make ​​the switch of path because if I rename JSONKit.h/.m I have a new second error:

"no such file or directory: '/Users/usermac/APProyectos/iOS/ShareKit/Classes/ShareKit/Core/Helpers/../../../../Submodules/JSONKit/JSONKit.m'"

What do I doing wrong?

I need you help.

Thanks.