Recently upgraded to Android Studio 4.2.1
I can launch my app successfully but when I try to attach the debugger I get the error in the question title (see screenshot below).
The app just gets stuck on the "Waiting For Debugger" screen.
Everything worked as expected prior to upgrade.
This is the output from the debug log
$ adb shell am start -n "com.*.*/com.*.*.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -D
Waiting for application to come online: com.*.* | com.*.*.test
Waiting for application to come online: com.*.* | com.*.*.test
Connected to process 9869 on device 'amazon-kfmuwi-G0W0X8089256FRU1'.
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
W/ActivityThread: Application com.*.* is waiting for the debugger on port 8100...
I/System.out: Sending WAIT chunk
Connecting to com.*.*
Now Launching Native Debug Session
com.intellij.execution.ExecutionFinishedException: Execution finished
Process finished with exit code 0
In logcat I also see
2021-05-19 12:55:32.855 10394-10394/? E/azon.kindle.cm: Not starting debugger since process cannot load the jdwp agent.
I have tried: Restarting Android device Restarting development device Invalidating and Restarting Android Studio Reinstalling Android Studio
My system is running Pop!_OS 20.10
Debug error
I've solved that by installing 'libncurses5' and 'ia32-libs' packages
This is a known issue and is provided on the android developer's official page. Here is the link https://developer.android.com/studio/known-issues?hl=de#native_debugger_crashes_with_debugger_process_finished_with_exit_code_127
It turns out it's a Linux-specific issue and is because Linux uses upgraded 'libncurses6' and android studio uses 'libncurses5' required to run the debugger.
I've solved this by installing 'libncurses5' only
sudo apt install libncurses5
Thanks to Max Elkin
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With