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

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



Solution 1:[1]

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

Solution 2:[2]

project("myapplication")

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

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 scarecrow
Solution 2 Dharman