Arjun
Arjun

Reputation: 292

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 ..

Upvotes: 3

Views: 1918

Answers (2)

Arjun
Arjun

Reputation: 292

Following up on this incase someone comes by this,

I had to migrate Android/Application mk files to CMakeLists.txt.

Linked to c++ project within android studio, and 9 months later ... at last ... debugging capabilities

Upvotes: 0

Keunhui  Park
Keunhui Park

Reputation: 21

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!

Upvotes: 2

Related Questions