New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't debug inside library project #197
Comments
I assume you're debugging with LLDB (via Android Studio) and not GDB (via |
Yes via Android Studio. I'm pressing the
Is there instructions for how to use ndk-gdb with new cmake system? I haven't looked into |
I think For the Studio and LLDB issues, none of those components are actually in the NDK. Could you file a bug against Android Studio so they can take a look at it? http://tools.android.com/filing-bugs |
Ok filed under Android Studio. |
I know this is closed but I found this when having the same problem. I found a solution that worked for me: |
I spent a few hours trying to make the debugger actually stop on a breakpoint in some native C++ code that was built into a library. Eventually I got it working by doing the following (under Android Studio 3.3.1). Hopefully this helps someone else!
|
if you use "set(CMAKE_C_FLAGS/CMAKE_CXX_FLAGS "")" in CMakeLists.txt, it will overwrite the compiler default mode, causing debug symbols to be lost. TODO: |
Yes, this did help me. And I see the issue here was closed and one opened in Android Studio -- as I was about to gripe that this should be automatic in Android Studio. |
Thank you, this is the only thing that helped 🥳 |
@alexsorokoletov I should note that I no longer have to do this in Android Studio 4.1.x with the Android Gradle Plugin 4.1.x -- thankfully. |
Setup. 2 projects
app
project andlibModule
. This bug has 2 parts which I think are related so I'm putting both parts here.Part 1: Can't debug library project, setting breakpoints do not work. And when a segfault happens ndk breaks in "unknown function` and nothing useful can be done.
A workaround solution is in the main project do this:
and I can debug just fine. So far it's fine. This has the disadvantage of compiling everything twice.
part 2: Library project always compiles in the release folder
.externalNativeBuild
regardless what has been specified. Interesting though if I do "Build->build APK" in android studio RC2 it builds the debug build.Some discussion here
Some version specifiers
The text was updated successfully, but these errors were encountered: