使用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
。
答案 0 :(得分:0)
如果您查看API文档:
ExceptionReporter(Tracker tracker, ServiceManager serviceManager, java.lang.Thread.UncaughtExceptionHandler originalHandler)
GoogleAnalytics没有实现ServiceManager界面....幸运的是GAServiceManager。因此,如果你改变:
GoogleAnalytics.getInstance()
为:
GAServiceManager.getInstance()
它对我有用