Linker Errors With Google Analytics 3.0 for iOS SDK

If you are using the Google Analytics for iOS SDK v3.0 in your iOS app, it is likely that you will encounter linker errors after following the steps in the developer guide. Here is a snippet of the linker error I encoutered today –

1
2
3
4
5
6
7
Undefined symbols for architecture armv7:
  "_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)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

The developer guide doesn’t tell you to add AdSupport.framework in your project’s build phases. Once AdSupport.framework is added in your project, the linker errors go away.