AndroidStudio 中没有堆栈跟踪

Pol*_*fox 1 debugging android exception android-studio

我\xc2\xb4m尝试调试我\xc2\xb4m编写的Android应用程序,发现没有异常堆栈跟踪写入控制台/ logcat / messages。\n我尝试删除.gradle文件夹并重新启动android-工作室,有些帖子是如何推荐的,但它对我没有帮助。

\n\n

我使用 Android Studio 2.3.1 并使用虚拟 Nexus 5X API 25 和搭载 Android 6.0 的真实华为 P9 lite 进行测试。两种设备都存在问题。

\n\n

如果我删除 google play 服务依赖项,问题仍然存在。

\n\n
dependencies {\n    compile fileTree(include: [\'*.jar\'], dir: \'libs\')\n    androidTestCompile(\'com.android.support.test.espresso:espresso-core:2.2.2\', {\n        exclude group: \'com.android.support\', module: \'support-annotations\'\n    })\n    compile \'com.android.support:appcompat-v7:25.3.1\'\n    compile \'com.android.support:design:25.3.1\'\n    testCompile \'junit:junit:4.12\'\n    compile \'com.google.android.gms:play-services-maps:10.2.4\'\n}\n
Run Code Online (Sandbox Code Playgroud)\n\n

我的问题看起来有点像这个,但这个问题没有答案:\n AndroidStudio 应用程序崩溃后没有显示堆栈跟踪

\n\n

我可以通过断点找到错误,但这会花费我五倍的时间,然后只是阅读在哪里抛出什么异常。

\n\n

顺便说一句:控制台只打印 Log.e 消息,而不打印 Log.d。

\n

Bjö*_*hel 5

我有时也会遇到同样的情况。Android Studio 似乎认为它启动了一个新的调试会话,并且不再显示旧的日志。在这种情况下,我更改监视器设置:

  1. 在右侧的下拉菜单中我选择“无过滤器”
  2. 在搜索框左侧的下拉列表中,我选择“警告”或“错误”

这样我就可以看到所有错误/警告日志条目,果然,如果之前崩溃后没有任何错误/警告日志条目,它通常会与这些设置一起出现。

之后不要忘记更改回首选设置。