Android - debugging native AAR library code

I have the following situation. Due to some requirements, I have to extract some parts of our application into a separate AAR library. It looks like this:

  • Native C ++ code along with some Java shells compiled into AAR library
  • Then the library is added as the main module in the main application.

  • The compilation itself is configured using Gradle + CMake

Everything works as expected, but I have one problem, I can no longer debug my own C ++ - part. Both modules are compiled into DEBUG. It also does not help to set the LLDB symbol directory (in LIB_PATH / .externalNativeBuild / cmake / debug / ABI_XXX / CMakeFiles / native-lib.dir /). Setting the LLDB debug type also does not help.

When I return my library code to the main application, I can debug everything without problems.

Is it not possible to debug my own part of the AAR library? Or can someone tell me what I'm doing wrong?

+4
source share
1 answer

For some reason, I found this blog entry just now ... http://www.akaita.com/post/android-native-library-module-debug/

Although the author uses the experimental ndk plugin, I can confirm that it also works with the stable version of gradle + CMake!

+3
source

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


All Articles