Android Studio can't debug if I use C code

Viewed 611

Android Studio can't start the debugger if I use C code though JNI. Running it normally works well, but the debugger doesn't even start, regardless if I'm debugging Kotlin or C code.

It throws a message Debugger process finished with exit code 127. Rerun 'app' And the only detail it gave me is com.intellij.execution.ExecutionFinishedException: Execution finished.

Here I set up a simple github repository to replicate the error: https://github.com/perojas3/Android-JNI-debug-bug-example. It simply calls C code to get a string and then displays it in a toast.

And here I set up an small youtube video displaying the bug the way it is happening: https://youtu.be/8jIL5yqP7m8

I'm using Manjaro Linux right now.

2 Answers

I had the same issue and installing libncurses5 package solved it.

If using Ubuntu: sudo apt install libncurses5 and launch the debugger again (no android studio restart required).

I also had this issue. I was able to run and debug my code normally, but for some reason I started to get this crash while running on debugging mode:

Debugger process finished with exit code 127

After playing a lot with Android Studio's settings and Edit Configurations, clearing caches, restarting both Android Studio and the computer and many other things, nothing was helpful.

I struggled with it a lot and the fact that there're no discussions anywhere about it annoyed me a lot, so having no information online together with the previous feeling about it happening after upgrading to Android Studio 4.2, made me think maybe it's a new issue raised in Android Studio's new 4.2 version.

So, I decided to download Android Studio 4.1.3 and give it a try. It worked like a magic and I can finally debug my code :)

Related