" AndroidRuntime:关闭VM"没有别的

时间:2015-06-26 13:34:01

标签: android android-studio logcat

出于某种原因,LogCat在崩溃时不再报告任何堆栈跟踪。相反,我只得到以下信息:

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

这真的很奇怪,因为我已经在同一个项目上工作了三个月,而且最近(两天,三天前)堆栈痕迹停止显示。什么可能导致这个?如何让它再次显示堆栈跟踪?

2 个答案:

答案 0 :(得分:23)

我遇到了同样的问题。将Google Analytics升级到版本7(或7.3,我不记得了)后,我的应用程序在遇到错误时始终关闭,没有任何logcat消息。

事实证明,如果我在Google Analytics中同时启用自定义catch-all-exception处理程序(Thread#setUncaughtExceptionHandler)和报告崩溃功能,就会发生这种情况。

当我禁用其中一个时,logcat会再次显示堆栈跟踪。

答案 1 :(得分:14)

修复非常简单。

只需从

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

到:

tracker.enableExceptionReporting(false);

现在,它已恢复正常。

相关问题