Debugging native (called via JNI) code in Android Studio 2.1.2.

550 views
Skip to first unread message

John Daintree

unread,
Jul 25, 2016, 9:59:40 AM7/25/16
to android-ndk
Hello all,

I'm new to Android development, I've more familiar with C/C++ native development, so please forgive and stupidity on my part. 

I'm attempting to use Android Studio 2.1.2 to debug a native code library, called from the main activity (written in Java), via JNI, but I'm getting the following exception (details follow my signature).

The library in question hasn't been built in Android Studio, but from an external makefile project.If I configure the "Run Configuration->Debugger->"Debug type"" to "Java", the application (including the native code), runs fine. However, when I set the "debug type" to "Native" or "Hybrid" I get the exception below.

Is debugging an externally built native library supported? Or am I obliged to build the library with Android Studio too? 

I've downloaded and run (and stopped on a native breakpoint in), the teapot example at https://github.com/googlesamples/android-ndk.

My "Gradle version" is 2.1 (as it is in the teapot sample), My "Android plugin Version" is 2.1.2.

Thanks in advance, I'm happy to provide anything else, if anyone can help.
John.


"Exception in pugin Android NDK Support. Moments ago. Occurred 2 times since the last clear."


java.lang.NullPointerException
at com.android.tools.ndk.run.AndroidNativeDebugProcess$2.run(AndroidNativeDebugProcess.java:218)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:951)
at com.android.tools.ndk.run.AndroidNativeDebugProcess.initArtSigSegvFaultBreakpoint(AndroidNativeDebugProcess.java:213)
at com.android.tools.ndk.run.AndroidNativeDebugProcess.doLaunchTarget(AndroidNativeDebugProcess.java:170)
at com.jetbrains.cidr.execution.debugger.CidrDebugProcess$7.run(CidrDebugProcess.java:436)
at com.jetbrains.cidr.execution.debugger.CidrDebugProcess$MyCommandProcessor.consume(CidrDebugProcess.java:697)
at com.jetbrains.cidr.execution.debugger.CidrDebugProcess$MyCommandProcessor.consume(CidrDebugProcess.java:690)
at com.intellij.util.concurrency.QueueProcessor$2$1.run(QueueProcessor.java:110)
at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238)
at com.intellij.util.concurrency.QueueProcessor$2.consume(QueueProcessor.java:107)
at com.intellij.util.concurrency.QueueProcessor$2.consume(QueueProcessor.java:104)
at com.intellij.util.concurrency.QueueProcessor$3$1.run(QueueProcessor.java:215)
at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238)
at com.intellij.util.concurrency.QueueProcessor$3.run(QueueProcessor.java:212)
at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:366)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
at org.jetbrains.ide.PooledThreadExecutor$1$1.run(PooledThreadExecutor.java:55)

Jesse Stone

unread,
Apr 4, 2020, 5:04:51 PM4/4/20
to android-ndk
android-studio 3.6.2 / eclipse luna sr2 / ndk v19c, v20b, debug c/c++ test ok
https://fatalfeel.blogspot.com/2013/10/android-studio-with-eclipse-debug-jni.html

John Daintree於 2016年7月25日星期一 UTC+8下午9時59分40秒寫道:
Reply all
Reply to author
Forward
0 new messages