Cairoeditor
Cairoeditor

Reputation: 35

errors while integrating google analytics?

I'm still new to iOS developing, I need to add google analytics to my phonegap project, but I don't want to use the javascript way and treat it like a website, I want to add it a proper way using Objective-C. The problem is whenever I try to add the google analytics files and framework I get these errors:

Undefined symbols for architecture i386:

  "_deflate", referenced from:
      anon in libGoogleAnalyticsServices.a(NSData+zlib.o)

  "_deflateEnd", referenced from:
      anon in libGoogleAnalyticsServices.a(NSData+zlib.o)

  "_deflateInit2_", referenced from:
      anon in libGoogleAnalyticsServices.a(NSData+zlib.o)

  "_inflate", referenced from:
      anon in libGoogleAnalyticsServices.a(NSData+zlib.o)

  "_inflateEnd", referenced from:
      anon in libGoogleAnalyticsServices.a(NSData+zlib.o)

  "_inflateInit2_", referenced from:
      anon in libGoogleAnalyticsServices.a(NSData+zlib.o)

ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I'm also using admob with the app but admob is working fine, I also tried to search for duplicated files for google analytics but could not find any, when I try to add google analytics to any other project that does not include phonegap, it works fine. Please help me, I have been trying to make this work for 2 weeks now.

Upvotes: 1

Views: 826

Answers (1)

GenieWanted
GenieWanted

Reputation: 4513

You need to add libz.dylib in your project. To do that, click on your Project file --> Targets --> Build Phases --> Link Binary with Libraries --> Press + button and add libz.dylib. Clean and run the project.

Upvotes: 5

Related Questions