簡體   English   中英

iOS Google Analytics 在啟動時隨機崩潰

[英]iOS Google Analytics crash at start up, randomly

我遇到了一個隨機的 Google Analytics 崩潰問題。 當我的應用程序啟動並嘗試初始化 GANTracker 時,會發生此問題。 它是隨機發生的,很難重現。 我想知道在實施 GA 初始時是否有任何遺漏或者我應該避免的東西。

這是我的 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:]

任何建議將不勝感激!

更新:根據谷歌的問題數據庫,據稱這已在 GANTracker 的 v1.4 中得到修復: http://code.google.com/p/analytics-issues/issues/detail?id=162 http://code.google。 com/mobile/analytics/download.html


我在 GANTracker 啟動時遇到了同樣的崩潰,出現以下兩個錯誤之一:

NSInternalInconsistencyException:錯誤:無法准備 select session 語句 NSInternalInconsistencyException:錯誤:無法准備更新時間戳語句

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

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

在 sqlite3_prepare_v2 期間創建 googleanalytics.sql 文件時,它看起來像一個未處理的錯誤

對於我在 IOS4.3.3 上的一些用戶來說,這種情況經常發生,並且對於 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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM