Exception stack trace lost in Google Analytics v2 for Android?

帅比萌擦擦* 提交于 2019-12-18 04:52:19

问题


The stack trace is crucial to fix problems. In Android you can find nice reports in the Play store console. Unless you use Google Analytics V2. In this case Analytics seems to swallow the exceptions. Worse, Analytics seems to log only the first line of the exception and thus loosing the stacktrace. At least it is not shown in the error report.

Here's a snip from our analytics.xml:

<!-- Enable automatic exception tracking -->
<bool name="ga_reportUncaughtExceptions">true</bool>
<bool name="ga_debug">false</bool>

See also here: https://developers.google.com/analytics/devguides/collection/android/v2/exceptions#easytracker

So, could there be something missing/wrong in our app?


回答1:


As previous answer (user857661) says, see the Google Analytics docs on creating a new ExceptionReporter, or see my blog post on how to assign a custom ExceptionParser into the default handler.




回答2:


If you want to see complete exception trace on GA V3.0 onwards, send your exception like

String exceptionTrace = "Any custom string as well " + getExceptionDescription(Ex);    
EasyTracker.getInstance(context).send(MapBuilder.createException(exceptionTrace, false).build());



回答3:


You can overwrite the ExceptionParser class to get more info about the stacktrace: https://developers.google.com/analytics/devguides/collection/android/v2/exceptions#exception-parser. I am not sure if the stacktrace will be very readable in the Google Analyctics web interface though.



来源:https://stackoverflow.com/questions/14009883/exception-stack-trace-lost-in-google-analytics-v2-for-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!