“AndroidRuntime: Shutting down VM” with nothing else

独自空忆成欢 提交于 2019-11-27 14:32:31

问题


For some reason, LogCat doesn't report any stack traces anymore on crashes. Instead, I only get the following info:

D/AndroidRuntime: Shutting down VM
W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x40dd3960)

This is really weird because I've been working on the very same project for three months, and only recently (two, three days ago) the stack traces stopped showing. What could cause this? How can I get it to show stack traces again?


回答1:


I experienced the same problem. After upgrading Google Analytics to version 7 (or 7.3, I do not remember), my app always closes without any logcat messages when encountering an error.

It turns out that it happens if I enable both a custom catch-all-exception handler (Thread#setUncaughtExceptionHandler) and the report crash feature in Google Analytics.

When I disable one of them, the logcat displays the stack trace again.




回答2:


Very simple to fix.

Just change from

...
Tracker tracker; // from Google Analytics
...
tracker = analytics.newTracker(getStringRes(R.string.ga_tracker));
tracker.enableExceptionReporting(true); // this is the cause

To:

tracker.enableExceptionReporting(false);

Now, it's back to normal.



来源:https://stackoverflow.com/questions/31074585/androidruntime-shutting-down-vm-with-nothing-else

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