我还是iOS开发的新手,我需要将谷歌分析添加到我的phonegap项目,但我不想使用javascript方式并将其视为一个网站,我想以正确的方式添加它Objective-C的。问题是每当我尝试添加谷歌分析文件和框架时,我都会遇到这些错误:
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)
我也在app中使用admob,但是admob工作正常,当我尝试将google analytics添加到任何其他不包含的项目时,我也试图搜索谷歌分析的重复文件但找不到任何文件phonegap,它工作正常。请帮助我,我一直试图让这项工作持续两周。
答案 0 :(得分:5)
您需要在项目中添加 libz.dylib 。为此,请单击您的项目文件 - >目标 - >构建阶段 - >链接二进制文件与库 - >按+按钮添加libz.dylib
。清理并运行项目。