duplicate symbol _OBJC_METACLASS_$_SBJsonWriter error

5047
6
08-23-2010 12:33 PM
KevinPinkerman
New Contributor
After creating a successful application using the ArcGIS library, I am attempting to add the Facebook library functions.  Once the library files are added (no extra code written), the following error appears:

ld: duplicate symbol _OBJC_METACLASS_$_SBJsonWriter in /Users/.../Library/SDKs/ArcGIS/iphonesimulator.sdk/usr/local/lib/libArcGIS.a(SBJsonWriter.o) and /Users/.../build/App.build/Debug-iphonesimulator/App.build/Objects-normal/i386/SBJsonWriter.o

This seems to be an issue with the libArcGIS.a framework conflicting with Facebook's library.  Is this a known issue?  Does anyone know of a workaround?  Thanks!
0 Kudos
6 Replies
wuting
by
New Contributor
I have the same problem ...

JSON-framework can't work with ArcGIS...

the same error....
0 Kudos
DiveshGoyal
Esri Regular Contributor
Version 2.3 of the JSON framework (http://code.google.com/p/json-framework/) is included with the ArcGIS library. Before ArcGIS API for iOS v1.0, the JSON headers were not made public by the ArcGIS library. But now they are.

So all you need to do is remove the additional JSON library from your project. As long as you are referencing the ArcGIS library, you will have access to the JSON classes.
0 Kudos
wuting
by
New Contributor
Version 2.3 of the JSON framework (http://code.google.com/p/json-framework/) is included with the ArcGIS library. Before ArcGIS API for iOS v1.0, the JSON headers were not made public by the ArcGIS library. But now they are.

So all you need to do is remove the additional JSON library from your project. As long as you are referencing the ArcGIS library, you will have access to the JSON classes.


it works, thx 🙂
0 Kudos
KevinPinkerman
New Contributor
Version 2.3 of the JSON framework (http://code.google.com/p/json-framework/) is included with the ArcGIS library. Before ArcGIS API for iOS v1.0, the JSON headers were not made public by the ArcGIS library. But now they are.

So all you need to do is remove the additional JSON library from your project. As long as you are referencing the ArcGIS library, you will have access to the JSON classes.


Just got back to this issue and read the suggestion.  Followed it and Facebook's reference to the SBJSON.h library file fails.  Tried several attempts at workarounds, including removing the .m files only, but was only able to get this thing to compile by renaming Facebook's SBJSON objects to SB2JSON.  This is a horrible way to get around this and I'm open to other suggestions.  I would suggest, however, that since the popularity of SBJSON is quite high I believe a different solution is necessary compiling the ArcGIS static library file.  Suggestion is found here: http://stackoverflow.com/questions/2300867/how-can-i-avoid-duplicate-symbol-errors-in-xcode-with-sha...  This suggestion of avoiding the -all_load flag may make it much easier for 3rd-party developers to still use the SBJSON framework along with ArcGIS.
0 Kudos
KOLDODUARTE
New Contributor
Just got back to this issue and read the suggestion.  Followed it and Facebook's reference to the SBJSON.h library file fails.  Tried several attempts at workarounds, including removing the .m files only, but was only able to get this thing to compile by renaming Facebook's SBJSON objects to SB2JSON.  This is a horrible way to get around this and I'm open to other suggestions.  I would suggest, however, that since the popularity of SBJSON is quite high I believe a different solution is necessary compiling the ArcGIS static library file.  Suggestion is found here: http://stackoverflow.com/questions/2300867/how-can-i-avoid-duplicate-symbol-errors-in-xcode-with-sha...  This suggestion of avoiding the -all_load flag may make it much easier for 3rd-party developers to still use the SBJSON framework along with ArcGIS.


Hi,

I am trying to connect with facebook from my ArcGIS proyect and I have the same problem with Graph API (facebook), this API has JSON folder and the proyect has a duplicate symbol, I have this error.

I have done Kevin says and now, XCode does not found in the ".h" file the line "#import "fbconnect.h". XCode does not found this file into my proyect.

Does anyone know of a workaround?

Thanks & Regards!
0 Kudos
KOLDODUARTE
New Contributor
Hi,

Someone has added a Graph API from Facebook to esri proyect?... How you managed to avoid JSON duplicates?

Thanks & Regards,
Koldo.
0 Kudos