mikl
mikl

Reputation: 1007

USB debugging quickly gives ANR on breakpoint and debugging ends

I get ANR after some seconds within breakpoint while USB debugging. Once ANR, the debugging ends and can't inspect the values for long enough in Visual Studio. Notice: also when this happens the app goes to the background and when brought to the front it's restarted.

Here are the output lines right from the moment the debugging ends (last output lines, only 3):

[libc] Requested dump for pid 22650 (com.companyname.appname)
[Looper] dumpMergedQueue
[OplusLooperMsgDispatcher] dumpMsgWhenAnr

I tryed "Select debugging app" on Android but it did nothing.

Workaround 1

Debug in the qemu emulator, but if I need to test the camera I am in problem again because I tryed to use the camera simulator but couldn't move the protagonist.

Update:

To move the protagonist or change the sight angle, keep the alt key pressed and use the WASD keys to move front/back/left/right, use the Q and E keys to move up/down, and use the mouse to look in any direction. You will find the configured images on the wall and table in the dinning room.

Workaround 2

Do not use breakpoints and just log information to VS Output with System.Diagnostics.Debug.WriteLine, and debug based on that information.

Ideal solution

The solution to this question would ideally be to be able to examine values in a breakpoint for as long as I want with USB debugging, I guess that's how it's supposed to work.

How to reproduce

  1. Create a new solution with ".NET MAUI App" template.
  2. Place a breakpoint in the OnCounterClicked method.
  3. Run USB debug with Android device.
  4. Reach the breakpoint and wait around 10 seconds.
  5. See debug ending with "dumpMsgWhenAnr" in VS Output.

Debugging on Visual Studio 17.10.1 for Windows with Android 14 device.

Upvotes: 0

Views: 191

Answers (1)

Shuowen He-MSFT
Shuowen He-MSFT

Reputation: 647

My device is Pixel 5. According to your problem, I did the following test:

Create a default MAUI project, deploy the project to the Pixel5 device, and set a breakpoint in the OnCounterClicked method. After the project starts, click the button and wait for 10seconds, the result is that no ANR appears.

You can try to update VS to the latest version (currently the latest version is 17.10.3). In addition, you can try to run the default project on other Android devices to check whether the same problem occurs.

Upvotes: 1

Related Questions