Android NDK cannot debug native code with two gradle plugins

I use NDK with the experimental gradle plugin, and initially I was able to debug my own code.

Then I saw this question https://github.com/googlesamples/android-ndk/issues/119 and this blog post http://frogermcs.imtqy.com/json-parsing-with-flatbuffers-in-android/ . This approach would be great, because I could use the stable gradle plugin for specific android code and the experimental gradle plugin for native code, because it would be useful to use data binding binding, for example. I was able to use this structure, but I lost the ability to debug my own code.

I created a sample project that illustrates my problem. https://github.com/4brunu/AndroidNDKDebug

There you can find two projects. The first "hello-jni-one-gradle -plugin" uses only the experimental gradle plugin, and I can debug my own code. The second one is "hello-jni-two-gradle-plugins", I use the stable gradle plugin for specific android code and the experimental gradle plugin for native code, and I cannot debug my own code.

Am I doing something wrong? Could you help me enable the built-in code debugger in the second project?

thanks

+5
source share
1 answer

I use the same setup in one of my projects, with Android Studio 2.1-preview5, gradle-experimental 0.7.0-alpha5 and gradle plugin 2.1.0-alpha5, and debugging works.

The secret missing step is to add the path to your unoccupied libraries to the debugger: lib/build/intermediates/binaries/release/obj/ABI

ndk debug symbol directories

+3
source

Source: https://habr.com/ru/post/1246619/


All Articles