Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enable stacktrace in android studio? Where is its window?

I develop an app which has problem in HTTP execute method. Someone suggested me to check stacktrace. But I don't know how!

So how can I enable it? where is exactly its window?

I put --full-stacktrace in File > Settings > compiler > command-line options . So I just see Threads and Frames in Debugger window.

(I know about log cat and I use it, I need to use stack trace)

like image 491
Taher Avatar asked Oct 19 '15 07:10

Taher


1 Answers

You're looking for Logcat. The keybind to bring it up is Alt+6. You can also bring it up by clicking on it at the bottom of android studio:

Logcat

Perhaps you are catching the exception but ignoring the result, you can log your stacktrace like this:

public void doSomething() {
    try {
        //do something that might throw an exception
    } catch (Exception e) { //be as specific as possible when catching an exception
        Log.e("ExceptionTag", e.getMessage(), e);
    }
}
like image 70
nbokmans Avatar answered Nov 12 '22 22:11

nbokmans