Android Studio - editing and debugging the native code

I’ve created a project with cocos2d-x v3.9 and successfully building and deploying an app using Android Studio.

However the project doesn’t include the Classes folder (or at least, I haven’t found the folder in the Project tree), so I’m currently editing the code in Xcode, then compiling on Android Studio to test my android builds. This is a bit cumbersome, and I was wondering if I can add my cpp files to the project without breaking anything (I’ve not used Android Studio much previously).

Also I was hoping for some native code debugging support. I created a new Debug Configuration as Android Native, but it reported that it was not JNI debuggable, at which point my lack of gradle knowledge got in the way - since we’re compiling the native library with cocos I suspect it’s not going to help me anyway, but has anyone managed to do this?

Ok, removing the ‘not JNI debuggable’ error was simple, simply do Open Module Settings, and under the Build Types tab set Jni Debugging to true.

Except it doesn’t really help as I’m not able to set breakpoints without the cpp code being in the project to set breakpoints in. Maybe there’s a gdb way of setting a breakpoint using function names or line numbers?

Did you ever sort this? I’m trying to debug some code on an android phone and it’s proving very difficult. The classes cpp files aren’t in the project directory but under jni there is the main.cpp which would give me a route into my code but breakpoints in there are simply ignored. Can anyone advise?