Linker errors when trying to install new Google Analytics 3.0 Beta

Ser Pounce picture Ser Pounce · Aug 17, 2013 · Viewed 19.9k times · Source

I believe just today Google released a new update to their iOS Analytics frame work (version 3.0). When I follow the instructions and try to run the code, I get:

Undefined symbols for architecture armv7: "_inflate", referenced from: l002 in libGoogleAnalyticsServices.a(NSData+zlib.o) "_deflate", referenced from: l001 in libGoogleAnalyticsServices.a(NSData+zlib.o) "inflateInit2", referenced from: l002 in libGoogleAnalyticsServices.a(NSData+zlib.o) "_deflateEnd", referenced from: l001 in libGoogleAnalyticsServices.a(NSData+zlib.o) "_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)
"_inflateEnd", referenced from: l002 in libGoogleAnalyticsServices.a(NSData+zlib.o) "_SCNetworkReachabilityCreateWithName", referenced from: l027 in libGoogleAnalyticsServices.a(GAIReachabilityChecker.o) l002 in libGoogleAnalyticsServices.a(TAGNetReachability.o) "_SCNetworkReachabilitySetCallback", referenced from: l027 in libGoogleAnalyticsServices.a(GAIReachabilityChecker.o) l002 in libGoogleAnalyticsServices.a(TAGNetReachability.o) l003 in libGoogleAnalyticsServices.a(TAGNetReachability.o) "deflateInit2", referenced from: l001 in libGoogleAnalyticsServices.a(NSData+zlib.o) "_SCNetworkReachabilityScheduleWithRunLoop", referenced from: l027 in libGoogleAnalyticsServices.a(GAIReachabilityChecker.o) l002 in libGoogleAnalyticsServices.a(TAGNetReachability.o) "_SCNetworkReachabilityUnscheduleFromRunLoop", referenced from: l027 in libGoogleAnalyticsServices.a(GAIReachabilityChecker.o) l003 in libGoogleAnalyticsServices.a(TAGNetReachability.o) ld: symbol(s) not found for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see invocation)

Possible they forgot to include a lib I need to add? (some other aspects of the instructions they forgot to change as well). Otherwise have followed their instructions to a tee and still not getting the needed results.

Answer

Ser Pounce picture Ser Pounce · Aug 18, 2013

I had to add both libz.dylib and AdSupport.framework to the build phases to make this go away. Google doesn't include these in their instructions so going to check with them to make sure this is OK then will update this post.

UPDATE: Now you also need to add libsqlite3.0.dylib to get it to work.