Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debugging Android Studio 2.2 CMake vs NDK-Build

Today I downloaded the new stable version of Android Studio 2.2.

I want to using c++ debugging in my Android Studio Project.

When I start a new project, with the Include C++ Support selected within the wizard, I am able to create a hello-jniString program which debugs exactly as expected; both java and c++ breakpoints are hit..

However when open an existing project, click the project in the project panel and click "Link to C++ project". It seems to link and compiles changes well ... however, when I try to debug only Java breakpoints are hit :(

Any help into this would be greatly appreciated .. completely baffled at the fact that no real support/documentation exists for debugging ndk and that c++ ndk integration is so all over the place when Android seems so mature ..

like image 525
Arjun Avatar asked May 23 '26 13:05

Arjun


1 Answers

I had slightly different case (debugging jni of library module, built by cmake), but you may try this.

Run > Edit Configuration > select 'Debugger' tab

add symbol directory of your debug symbol placed.

in my case, that was LIB_MODULE/.externalNativeBuild

I can debug c++ now but still finding how to turn off optimization option. Good luck!

like image 115
Keunhui Park Avatar answered May 25 '26 02:05

Keunhui Park



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!