没有别的东西,"AndroidRuntime:关闭VM"

man*_*eak 21 android logcat android-studio

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

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

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

Ran*_*ku' 24

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

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

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


Fad*_*ils 14

修复非常简单.

只是改变

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

至:

tracker.enableExceptionReporting(false);
Run Code Online (Sandbox Code Playgroud)

现在,它已恢复正常.