سؤال

I'm using MKStoreKit in my application. Now I'd like to add RestKit as well, but after adding RestKit, I get the following error message in XCode:

Duplicate symbol _jk_collectionClassLoadTimeInitialization in [...]/libRestKitJSONParserJSONKit.a(JSONKit.o) and [...]/Objects-normal/armv7/JSONKit.o for architecture armv7

Any ideas what I can do about it?

Thanks a lot!

EDIT: If I remove the JSONKit from MKStoreKit, I get the following error:

enter image description here

هل كانت مفيدة؟

المحلول

That error is caused by a clash between JSONKit framework bundled with MKStoreKit and the fact that`RestKit brings in the JSONKit as well.

The simplest solution is to remove JSONKit.m file from your project (the one that came with MKStoreKit) and keep the JSONKit.h header. Be sure to link your project with the JSONKit that is provided with RestKit framework. This will allow your project to 'see' the JSONKit and the linker links it with the bundled library.

نصائح أخرى

I had same issue with Deezer and AdFonic static library. But both of libraries are closed source. In this case, the solution is then to remove symbols from library.

Nathan de Vries post a great tutorial here:

http://atnan.com/blog/2012/01/12/avoiding-duplicate-symbol-errors-during-linking-by-removing-classes-from-static-libraries/

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top