iOS Google Analytics在启动时随机崩溃

时间:2011-08-14 01:57:37

标签: ios crash google-analytics

我遇到了随机的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:]

任何建议都将不胜感激!

1 个答案:

答案 0 :(得分:0)

更新:根据Google的问题数据库,据称这已在GANTracker的v1.4中修复: http://code.google.com/p/analytics-issues/issues/detail?id=162 http://code.google.com/mobile/analytics/download.html


我在GANTracker启动时遇到了这两个错误之一:

  

NSInternalInconsistencyException:错误:无法准备选择会话语句   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文件或者make语句失败时添加一些错误处理。

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