I have the following situation. Due to some requirements I've to extract some parts of our app into a separate AAR library. So it looks like that:
The library is then added as a library module in the main app
The compilation itself is configured with Gradle + CMake
Everything works as expected but I've one problem, I cannot debug the native C++ part anymore. Both modules are compiled in DEBUG. It also doesn't help to set the LLDB symbol directory (to LIB_PATH/.externalNativeBuild/cmake/debug/ABI_XXX/CMakeFiles/native-lib.dir/). Setting the LLDB debug type doesn't seem to help either.
When I put my library code back into the main app I can debug everything without a problem.
Is it simply not possible to debug the native part of an AAR library? Or can anyone tell me what I'm doing wrong?
While debugging when it prompt “Choose Sources”, Click on that option and select the “main” folder of the library module from your local codebase of the library. Now try to debug (by choosing 'step into' option etc), the debugger should able to get the source code.
Add your AAR or JAR as a dependency To use your Android library's code in another app module, proceed as follows: Navigate to File > Project Structure > Dependencies. In the Declared Dependencies tab, click and select Jar Dependency in the dropdown. In the Add Jar/Aar Dependency dialog, first enter the path to your .
An AAR is similar to a JAR file, but it can contain resources as well as compiled byte-code. AAR files can contain Android resources and a manifest file, which allows you to bundle in shared resources like layouts and drawables in addition to Java classes and methods.
For some reason I found this blog entry only now... http://www.akaita.com/post/android-native-library-module-debug/
Although the author is using the experimental ndk plugin I can confirm that it's also working with the stable gradle version + CMake!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With