问题
By default Google Analytics reports only the top line of an uncaught exception in its crash reports (see first picture in this blog post).
I have problems having Google Analytics to show stack traces of uncaught exceptions in my app that reflect the whole stack, rather than the first line (see second picture in the blog post mentioned above for the intended result).
The problem as well as a solution are explained on this blog post mentioned above. However, the solution relates to v2 of the Google Analytics library and not to the current v4 (the EasyTracker class is obsolete).
As the Google Analytics documentation states the correct approach should be to create a custom ExceptionParser and use this for formatting the exception message before sending to Google. My problem is that this example in documentation relates to a caught exceptions handled in a try-catch block in the code. I would like to do the same for all uncaught exceptions, the ones that I do not handle in a try-catch block.
Any pointers in the right direction would be appreciated greatly.
来源:https://stackoverflow.com/questions/24001136/how-create-detailed-stack-traces-in-google-analytics-v4-crash-reports-for-uncaug