Android Studio NDK "hello from C++" project can't debug (can't set breakpoint)?

Viewed 764

Android Studio is BumbleBee 2021.1.1 Path 2, just new a Native C++ project, the Build menu | Edit Build Types, click debug, jni Debuggable selects "true", the Run | Edit configuration, Debugger tab, selects "Native only", in native-lib.cpp, set a breakpoint, then Run | Debug app, the breakpoint will not be hit!

I have tested these in two computers, meet the same problem. Is there anything more need to do?

Edit: If selects "Dual" in debugger tab, The breakpoint in Kotlin is OK, see pic 4. but the breakpoint in native-lib.cpp still does not be hit.breakpoint in kotlin lldb server started

Edit build Types

Edit configuration

The breakpoint will not be hit

2 Answers

Update android studio to preview release Dolphin (2021.3.1) Canary 7

project("myapplication")

You can try to add project("myapplication") to cmakelist and upgrade gradle to 7.1.2.

Related