1

I'm trying to add the facebook SDK 3.2 to my app but after I add the -ObjC linker flag (as described in their video) I get a lot of duplicates warnings and I can't run the app with the error:

duplicate symbol _OBJC_IVAR_$_GAI.defaultTracker_ in:
    /Users/gool/proj/Frameworks/GANT/libGoogleAnalytics.a(GAI.o)
    /Users/gool/proj/Frameworks/GANT/libGoogleAnalytics_debug.a(GAI.o)
duplicate symbol _OBJC_IVAR_$_GAI.dispatcher_ in:
    /Users/gool/proj/Frameworks/GANT/libGoogleAnalytics.a(GAI.o)
    /Users/gool/proj/Frameworks/GANT/libGoogleAnalytics_debug.a(GAI.o)
duplicate symbol _kGAIProduct in:
    /Users/gool/proj/Frameworks/GANT/libGoogleAnalytics.a(GAI.o)
    /Users/gool/proj/Frameworks/GANT/libGoogleAnalytics_debug.a(GAI.o)
duplicate symbol _kGAIVersion in:
    /Users/gool/proj/Frameworks/GANT/libGoogleAnalytics.a(GAI.o)
    /Users/gool/proj/Frameworks/GANT/libGoogleAnalytics_debug.a(GAI.o)
duplicate symbol _OBJC_IVAR_$_GAI.trackUncaughtExceptions_ in:
    /Users/gool/proj/Frameworks/GANT/libGoogleAnalytics.a(GAI.o)
    /Users/gool/proj/Frameworks/GANT/libGoogleAnalytics_debug.a(GAI.o)

        /Users/gool/Documents/FacebookSDK/FacebookSDK.framework/FacebookSDK(Facebook.o)
    ld: 172 duplicate symbols for architecture i386
    clang: error: linker command failed with exit code 1 (use -v to see invocation)

Thanks

Segev
  • 19,035
  • 12
  • 80
  • 152
  • Did you clicked the checkmark ( add to targets ) while adding the sdk to your app? – user247 Mar 14 '13 at 09:43
  • Yes, Did it twice and made sure the add to targets is checked. I followed this: "Choose 'Create groups for any added folders' and deselect 'Copy items into destination group's folder (if needed)' to keep the reference to the SDK installation folder, rather than creating a copy." – Segev Mar 14 '13 at 09:45
  • ok in the other linker flags add this command -ObjC -all_load It may help you – user247 Mar 14 '13 at 09:48
  • after every change don't forget to clean the project – user247 Mar 14 '13 at 09:52
  • Most likely the problem can be solved by looking at the "lot of duplicates warnings". – Matthias Bauch Mar 14 '13 at 09:53
  • Couldn't find the problem there, I edited my question with part of the warnings I get. Tried cleaning Derived Data but it didn't do much. – Segev Mar 14 '13 at 10:00
  • Did you see http://stackoverflow.com/questions/12352267/duplicate-symbol-objc-class-facebook ? – Matthias Bauch Mar 14 '13 at 10:07
  • it may help you dude Another reason this error often happens is accidentally importing the .m file instead of the .h file . – user247 Mar 14 '13 at 10:10
  • @MatthiasBauch Just now. I do have an old FBConnect class in my project but I couldn't understand the answer from the link you gave on how to fix it. – Segev Mar 14 '13 at 10:13
  • A small update. The problem is there if I add the -ObjC even before adding the facebook SDK so it must be something with google Analytics and the warnings above (which I don't get before adding the -ObjC) – Segev Mar 14 '13 at 10:55

1 Answers1

3

Deleting libGoogleAnalytics_debug.a and the facebook old sdk solved my problem

Segev
  • 19,035
  • 12
  • 80
  • 152