1

I have some trouble wuth using Google Analytics in my project.

I added libraries described in Google Analytics SDK documentation, but still have seven troubles. Here it is

Undefined symbols for architecture i386:
 "_OBJC_CLASS_$_ASIdentifierManager", referenced from:
  objc-class-ref in libGoogleAnalyticsServices.a(TAGAdvertiserId.o)
  objc-class-ref in libGoogleAnalyticsServices.a(TAGAdvertisingTrackingEnabledMacro.o)
  objc-class-ref in libGoogleAnalyticsServices.a(TAGMobileAdwordsUniqueIdMacro.o)
  "_llvm_gcda_emit_arcs", referenced from:
  ___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAIUtil.o)
  ___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAIDefaultLogger.o)
  ___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAI.o)
  ___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAITrackerImpl.o)
  ___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAIDataStore.o)
  ___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAIError.o)
  ___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAICoreDataUtil.o)
  ...
  "_llvm_gcda_emit_function", referenced from:
  ___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAIUtil.o)
  ___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAIDefaultLogger.o)
  ___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAI.o)
  ___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAITrackerImpl.o)
  ___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAIDataStore.o)
  ___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAIError.o)
  ___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAICoreDataUtil.o)
  ...
  "_llvm_gcda_end_file", referenced from:
  ___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAIUtil.o)
  ___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAIDefaultLogger.o)
  ___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAI.o)
  ___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAITrackerImpl.o)
  ___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAIDataStore.o)
  ___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAIHit.o)
  ___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAIError.o)
  ...
  "_llvm_gcda_increment_indirect_counter", referenced from:
  -[GAI defaultTracker] in libGoogleAnalytics_debug.a(GAI.o)
  -[GAI setDefaultTracker:] in libGoogleAnalytics_debug.a(GAI.o)
  -[GAI clientId] in libGoogleAnalytics_debug.a(GAI.o)
  -[GAI dispatchInterval] in libGoogleAnalytics_debug.a(GAI.o)
  -[GAI setDispatchInterval:] in libGoogleAnalytics_debug.a(GAI.o)
  -[GAI trackUncaughtExceptions] in libGoogleAnalytics_debug.a(GAI.o)
  -[GAI setTrackUncaughtExceptions:] in libGoogleAnalytics_debug.a(GAI.o)
  ...
  "_llvm_gcda_start_file", referenced from:
  ___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAIUtil.o)
  ___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAIDefaultLogger.o)
  ___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAI.o)
  ___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAITrackerImpl.o)
  ___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAIDataStore.o)
  ___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAIHit.o)
  ___llvm_gcov_writeout in libGoogleAnalytics_debug.a(GAIError.o)
  ...
   ld: symbol(s) not found for architecture i386
   clang: error: linker command failed with exit code 1 (use -v to see invocation)

I don't understand what I have to do. Can you help me? Thanks. Sorry for my English :)

Amar
  • 13,202
  • 7
  • 53
  • 71
WantToKnow
  • 1,767
  • 2
  • 12
  • 18

6 Answers6

4

Remove libGoogleAnalytics_debug.a from the project.

I got the same error and realized the error was on libGoogleAnalytics_debug.a. Google's documentation doesn't say anything about adding libGoogleAnalytics_debug.a so I removed it from the project and the errors went away.

webhead
  • 99
  • 7
  • Adding AdSupport.framework only solved the "_OBJC_CLASS_$_ASIdentifierManager" problem - this little hint solved the problems with "_llvm_gcda_emit_arcs" etc.! Thanks! – Florian Nov 10 '13 at 14:55
3

You need to add the AdSupport.framework to your project. This is missing from Google's instructions.

DiscDev
  • 38,652
  • 20
  • 117
  • 133
1

I've got two main issues adding GAM 3:

  1. they don't write but you need to add also the AdSupport.framework
  2. The last version I've tried wasn't compatible with 64bit architecture (that will happen if you deploy only on iOS7)
Andrea
  • 26,120
  • 10
  • 85
  • 131
0

Here I answered a question about GA : link There, I added a lot of information about GA. There are information for 2.0beta, and for 3.0 too (after "EDIT for 3.0:"). I'm using 2.0beta and it works okey.

Community
  • 1
  • 1
Magyar Miklós
  • 4,182
  • 2
  • 24
  • 42
0

Just Use Following files:

GAI.h
GAIDictionaryBuilder.h
GAIFields.h
GAILogger.h
GAITrackedViewController.h
GAITracker.h
libGoogleAnalyticsServices.a

as you can see on CuteAnimal of GA example

Arash Zeinoddini
  • 801
  • 13
  • 19
0

Adding AdSupport.framework cleared the linker errors. worked for me.

ohad
  • 1
  • Please, try to read this http://stackoverflow.com/about, to get more understanding about questions/answers here on SO. Your contribution is not answering the question. It is more a comment, which you can add once you'll increase your reputation: http://stackoverflow.com/faq#reputation – Radim Köhler Dec 30 '13 at 12:24