2011-08-14 85 views
3

我遇到了一個隨機的Google Analytics崩潰問題。 當我的應用程序啓動並嘗試初始化GANTracker時,會發生此問題。 它隨機發生,非常難以複製。我想知道是否有任何我錯過了,或者我應該避免執行GA初始。iOS Google Analytics崩潰,隨機啓動

這裏是我的GANTracker初始代碼:

#define GAKey @「UA-xxxxxx-x" 

static const NSInteger kGANDispatchPeriodSec = 10; 
[[GANTracker sharedTracker] startTrackerWithAccountID:GAKey 
             dispatchPeriod:kGANDispatchPeriodSec 
              delegate:nil]; 

當我開始了這一點,我的代碼使用方法做一些同步的網絡活動中的另一個輔助線程。

[NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil] 

這裏是崩潰日誌,希望它有助於

-[GANTracker startTrackerWithAccountID:dispatchPeriod:delegate:] 
-[GANPersistentEventStore init] 
-[GANPersistentEventStore initWithPath:] 
-[GANPersistentEventStore setupStatements] 
-[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] 
+[NSException raise:format:arguments:] 

任何建議,將不勝感激!

回答

0

UPDATE:根據谷歌的問題DB,據稱這是固定GANTracker的V1.4: http://code.google.com/p/analytics-issues/issues/detail?id=162 http://code.google.com/mobile/analytics/download.html


我得到的GANTracker啓動死機一樣與這兩個錯誤之一:

NSInternalInconsistencyException: Error: Failed to prepare select session statement NSInternalInconsistencyException: Error: Failed to prepare update timestamp statement

堆棧跟蹤斷言(不同的方法比OP):

- [GANTracker startTrackerWithAccountID:dispatchPeriod:delegate:] 
- [GANPersistentEventStore init] 
- [GANPersistentEventStore initWithPath:] 
- [GANPersistentEventStore initializeSession] 
- [NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] 

期間sqlite3_prepare_v2

這是反覆出現的一些我的IOS4.3.3用戶創建googleanalytics.sql文件時,也發生了隨機IOS4.2.1 我有同樣的它看起來像一個未處理的錯誤調度期作爲OP。不能在我自己的模擬器/設備上重現這一點。

我希望谷歌分析將釋放他們的源代碼,所以我可以添加一些錯誤處理,當sqlite文件無法創建或準備語句失敗。

有一個在GA論壇上的帖子在這裏有同樣的錯誤:http://www.google.com/support/forum/p/Google%20Analytics/thread?tid=20107fa00aae4f08&hl=en

這可能是同樣的問題,使用sqlite3_prepare_v2: http://www.iphonedevsdk.com/forum/iphone-sdk-development/2540-sqlite-method-sqlite3_prepare_v2-failing.html

+0

謝謝你的信息,雖然我還沒有得到任何線索。 ... – user268743

+1

我收到類似的崩潰:***由於未捕獲的異常'NSInternalInconsistencyException',原因:'錯誤:無法準備選擇custom_var_cache語句:1'嘗試在try catch中嘗試換行,而不是記錄發生此錯誤的用戶 –

+0

try/catch wrap對我無效,是否做過這項工作你是Eamonn?不過看到這崩潰的IOS5 –