当使用适用于Android v2的Google AnalyticsSDK无法获得任何崩溃或异常时,我尝试过EasyTracker和ExceptionReporter但没用?

时间:2012-12-03 08:02:43

标签: google-analytics

使用EasyTracker:<bool name="ga_reportUncaughtExceptions">true</bool>

Ues ExceptionReporter:

UncaughtExceptionHandler myHandler = new ExceptionReporter(
    myTracker,                                        // Currently used Tracker.
    GoogleAnalytics.getInstance(),                    // GoogleAnalytics singleton.
    Thread.getDefaultUncaughtExceptionHandler());     // Current default uncaught exception handler.

Thread.setDefaultUncaughtExceptionHandler(myHandler); // Make myHandler the new default uncaught exception handler.

我可以获取其他数据,例如事件,页面,但我无法获取任何崩溃和异常数据。我在程序中设置了一些uncatch异常和crashs

1 个答案:

答案 0 :(得分:0)

如果您查看API文档:

ExceptionReporter(Tracker tracker, ServiceManager serviceManager, java.lang.Thread.UncaughtExceptionHandler originalHandler) 

GoogleAnalytics没有实现ServiceManager界面....幸运的是GAServiceManager。因此,如果你改变:

GoogleAnalytics.getInstance()

为:

GAServiceManager.getInstance()

它对我有用