Does Android Studio JNI support debugging?

I want to debug code written in C. Currently, Android Studio 1.2.2 does not seem to support JNI debugging. Does it support Android Studio 1.5 RC 1, as a Java debugger?

+5
source share
3 answers

Android Studio supports JNI debugging for the first time with 1.3 RC 1. See here

To start using this feature, go to add your own code .

Check this repository for NDK samples for Android using the new C ++ version for Android Studio 1.3.

+4
source

Supported, but with limitations.

Limitations

Firstly, Android NDK support only works with the new experimental Gradle plugin for Android (which, in turn, requires Gradle 2.5).

While the new Gradle plugin provides some major performance improvements (and support for Android NDK builds), note that it also requires changes to the "DSL" build file (the way your build is described in your build.gradle files.) not only will you need to modify your build.gradle files (a process that we hope to automate before plug-in graduates are experimental to stable), but we expect some additional incompatible changes along the way.

Secondly, also note that Android Studio is not yet updated to fully process the experimental plugin. This means that, for example, the Project Structure Dialog and various quick fixes that automatically update assembly data do not work correctly. To configure your projects, you need to manually edit the build.gradle files. As another example, various templates that update build files (such as a new module) have not yet been updated.

Finally, there are still some known bugs in this assembly; when debugging with points LLDB does not always work on Windows; if you run into this, you can switch to debugging GDB as a temporary solution.

Source: http://tools.android.com/tech-docs/android-ndk-preview

+1
source

If your own code is wrapped as a library, you need to add this part to the gradle application :

model { android.sources { main { jniLibs { dependencies { project ":mynativelib" buildType "debug" } } } } 
0
source

All Articles