简体   繁体   English

集成Google Analytics(分析)时出错?

[英]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. 我仍然不熟悉iOS开发,我需要将Google Analytics(分析)添加到我的phonegap项目中,但是我不想使用JavaScript方式并将其像网站一样对待,我想使用Objective-C以适当的方式添加它。 The problem is whenever I try to add the google analytics files and framework I get these errors: 问题是,每当我尝试添加Google Analytics(分析)文件和框架时,都会出现以下错误:

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. 我也在应用程序中使用了admob,但admob正常运行,我还尝试搜索重复的文件以进行Google Analytics(分析),但找不到任何文件,当我尝试将google Analytics(分析)添加到任何其他不包含phonegap的项目时,它工作正常。 Please help me, I have been trying to make this work for 2 weeks now. 请帮助我,我已经尝试进行这项工作2周了。

You need to add libz.dylib in your project. 您需要在项目中添加libz.dylib To do that, click on your Project file --> Targets --> Build Phases --> Link Binary with Libraries --> Press + button and add libz.dylib . 为此,请单击您的项目文件->目标->构建阶段->用库链接二进制文件->按+按钮并添加libz.dylib Clean and run the project. 清理并运行项目。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM