简体   繁体   中英

Exception stack trace lost in Google Analytics v2 for Android?

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?

如前面的答案(user857661)所述,请参阅Google Analytics文档,了解如何创建新的ExceptionReporter ,或查看我的博客文章 ,了解如何将自定义ExceptionParser分配到默认处理程序中。

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());

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM