嘗試安裝新的 Google Analytics 3.0 Beta 時出現鏈接器錯誤 (Linker errors when trying to install new Google Analytics 3.0 Beta)


問題描述

嘗試安裝新的 Google Analytics 3.0 Beta 時出現鏈接器錯誤 (Linker errors when trying to install new Google Analytics 3.0 Beta)

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.


參考解法

方法 1:

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.

方法 2:

I downloaded version 3.06 of the Google Analytics Services for iOS in early April 2014, and STILL ran into the problems referenced above. Google has updated their docs to mention the need to link the libz.dylib and the AdSupport.framework. 

SOLUTION: I found through trial and error, I also needed to link the libsqlite3.dylib in order to build on the simulator or to a device.

方法 3:

Add

libz.dylib

AdSupport.framework

libsqlite3.0.dylib

Google did not update their guide as of 8 Oct 2013.

Google Analytics Guide is here

方法 4:

None of the above solutions worked for me. What did work for me, however, was adding these:  

libz.dylib

libsqlite3.0.dylib

libGoogleAnalyticsServices.a

The libGoogleAnalyticsServices.a is a file that can be found in the download for Google Analytics for Mobile Apps iOS SDK v3. 

Hope this helps!

方法 5:

I had libz.dylib and AdSupport.framework as per instruction from Google, it worked fine.

Then I had to add ‑all_load in other linker flags for some other library dependency, then google analytics started failing build with linker error.

I had to add libsqlite3.0.dylib framework to get it to work.

So there is something to do with ‑all_load linker flag

(by Ser PounceSer PounceDarrenNityaJoseph Gillkrisrak)

參考文件

  1. Linker errors when trying to install new Google Analytics 3.0 Beta (CC BY‑SA 3.0/4.0)

#google-analytics-api #iOS #google-analytics






相關問題

使用C#的Google Analytics(分析)訪問 (Google Analytics Access with C#)

嘗試安裝新的 Google Analytics 3.0 Beta 時出現鏈接器錯誤 (Linker errors when trying to install new Google Analytics 3.0 Beta)

Google Analytics:數據導入和每日上傳的區別 (Google Analytics: Difference between Data Import & Daily upload)

Google Reporting API for Analytics 庫依賴項 (Google Reporting API for Analytics library dependencies)

將 Google Analytics 權限分配給整個公司域 (Assign Google Analytics Permission To Whole Company Domain)

將 google-api-client 0.9.pre3 集成到 dashing 後的 NoMethodError (NoMethodError after integrating google-api-client 0.9.pre3 in dashing)

谷歌分析:在我的網站上顯示數據時,我可以使用自定義維度名稱而不是索引嗎 (Google analytics : Can I use custom dimension name instead of index while showing data on Report On my Site)

Pandas / Google Analytics API 身份驗證嘗試給我帶來了一個奇怪的 python 錯誤 (Pandas / Google Analytics API authentication attempt throws me a weird python error)

如何訪問行為流數據?(在應用程序 Google Analytics 帳戶上。) (How to access Behavior Flow data? (on a Application Google Analytics Account.))

如何在 Google Analytics 的一份報告中單獨細分指標? (How to individually segment metrics in one report in Google Analytics?)

Python - 問題使用循環每天得到 (Python - Problem use loops to get day by day)

我想要在 PHP 中使用 orderBy 和 Filters 的 Google Analytics Data API (GA4) 示例代碼 (I want a sample code for Google Analytics Data API (GA4) in PHP using orderBy and Filters)







留言討論