本文介绍了调试Android应用程序崩溃-附加时logcat中无信息,控制台中无信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Android Studio 1.5.1
compileSdkVersion 23

Android Studio 1.5.1
compileSdkVersion 23

正在发生的事情:

应用已附加到调试器.
我可以达到断点,逐步执行代码.
我有异常记录到控制台.
我正在尝试显示对话框片段.

App is attached to debugger.
I can hit breakpoints, step through code.
I have exceptions logged to the console.
I'm attempting to display a dialog fragment.

布局xml正确加载,并且我可以使用findbyid访问UI元素...

The layout xml loads properly, and I can access UI elements with findbyid...

问题不是围绕这个问题的细节,而是围绕为什么我似乎找不到关于崩溃的任何有意义的信息?

The question is not around the specifics of this problem, and is more around why I can't seem to find any meaningful information on the crash that occurs?

我已经将adb logcat的输出倒了,还打开了控制台,记录了所有异常.

I've poured over the output from adb logcat, and also had the Console open, logging all exceptions.

除了我的Android手机上显示的该应用程序崩溃的警报外,似乎什么也没有报告任何信息.

Nothing seems to report any info other than the alert displayed on my Android phone that the app crashed.

我已经搜索了,到目前为止找到的所有内容都指向:

I've searched and all the things I've found so far point to:

a.)在设备的调试模式下运行(执行此操作)
b.)记录异常(这样做)
c.)检查logcat(这样做)

a.) running in debug mode with a device (doing that)
b.) logging exceptions (doing that)
c.) checking logcat (doing that)

还有什么?我必须丢失一些东西.

What else is there? I have to be missing something.

推荐答案

您可能要尝试的一件事是设置未捕获的异常处理程序:

One thing that you might try is setting an uncaught exception handler:

http://developer.android.com/reference/java/lang/Thread.UncaughtExceptionHandler.html

如果您的错误没有被困在这里,那么就不会在您认为正在抛出该错误的线程上抛出该错误,或​​者该错误发生在Java异常处理机制的范围之外.

If you error doesn't get trapped here then it is not being thrown on the thread you think it is being thrown on, or the error is occurring outside the scope of the java exception processing mechanism.

这篇关于调试Android应用程序崩溃-附加时logcat中无信息,控制台中无信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 00:38
查看更多