androidandroid-studioandroid-9.0-pieandroid-debug

Android studio: USB debugging on Android P device gets stuck forever


Been facing this problem a lot of times, finally posting it on SO. I start debugging my app with some breakpoints and it works properly for some sessions. Abruptly after some time, I will reach a breakpoint and the debugger shows Evalutaing... and it won't evaluate until eternity. If I click resume or step buttons, the program won't proceed and the only way out is to disconnect and reconnect the device and start over.I am using latest stable Android studio.

Android 9 emulators work without issues. But I do get network connectivity issues on the P emulators. If I debug on Android O or lower devices, it works like charm.

Isn't anyone facing this issue? It's really frustrating when you don't have a device running lower Android version. Is downgrading to Oreo the only solution here? Any pointers will be appreciated.

Devices: Mi A2 (Android 9), Pixel 2 XL (Android 9).

Cables: Provided by both OEMs and tested to work perfectly in charging and data transfers.

Mode of debugging: USB

OS: MacOS Mojave and Ubuntu


Solution

  • Updating Android Studio to the next stable version fixed the issue. The debugger does not get stuck any more.