16

I am working with Google's Leanback library for Android TV and I am trying to figure out how to best listen for the buttons on the remote control (especially the ones that are not captured by the MediaSession).

For that reason I have a break point in BaseGridView.dispatchTouchEvent() and when I press one of the remote buttons the debugger does indeed jump to that point and shows me the usual debug information.

However, after a few (2-5) seconds the debug info disappears and is replaced by the message "Frame is not available".

In other places the debugger is working fine, so I was wondering whether the delay caused by the debugger is counted as ANR and the app is therefore force closed?

In any case, is there any way to get around this?

david.mihola
  • 12,062
  • 8
  • 49
  • 73
  • did you find any solution for this. I am facing the same on my machine while the same code work on other machine (frames does not disappear). – CodingRat Jan 21 '16 at 06:29
  • No, I am afraid not... But I didn't know that the error was dependent on the machine - I thought it was just related to some aspects of the code... – david.mihola Jan 21 '16 at 07:45

5 Answers5

4

This message appears because u set too many breakpoints, and threads are waiting data from other threads, to settle this, you could cancel some breakpoints and waiting for the data to be ready...

dan
  • 119
  • 1
  • 5
  • 2
    I was setting break points in different threads, while waiting for response, Your tip fixed my issue – abdimuna Apr 20 '17 at 11:28
2

the message "frames not available" means that no more frames are available for debugging. The android studio help states clearly the purpose of the frame window and the frames within:

The Frames pane enables you to gain access to the list of threads of your application , export to a text file and customize thread presentation. For each thread, you can view the stack frame, examine frames, navigate between frames, and automatically jump to a frame's source code in the editor. You can select a thread via a the thread selector drop-down list on top of the pane. The status and type of a thread is indicated by a special icon and a textual note next to the thread's name.

So now that you have no frames available means all frames are closed for debugging. Might be due to app being force closed or misbehaving at that line in any way. Try debugging the statement after which this happens to get rid of this behaviour. Hope it helps

404error
  • 133
  • 11
2

When you get the message "frames not available" it means that no more frames are available for debugging. The frames are part of Android Studio's debugging which gives you access to the list of threads running in your application. It is the long list of processes you see in the debugging window. So what is happening is that Android Studio loses knowledge of the threads it had before you set the breakpoint when you are stepping out. This might be happening in your case because by default when you set a breakpoint, it stops execution of all threads. When you step out, the threads that follow rely on the threads before to work which is what closes the app. Since you are setting your breakpoint at getCurrentDetails, my best assumption is that it did not get the response from OKHttp in time since it is happening in a background thread. You can try two things to get it to work. First, try and right click on the breakpoint and change the breakpoint from pausing all threads to just that thread. This should allow OKHttp to get the response in time before being cut off. Or, shift your breakpoint further down and see if it works.

0

Having the same issue, restarting AS works for me.

Kai Wang
  • 3,303
  • 1
  • 31
  • 27
-1

File --> Invalidate Caches/Restart fixed the problem that I had.

Jawad
  • 308
  • 3
  • 12