How do i add my cpp files to the cocos2d-x 3.7 android studio project?

Hello ive been goign nuts over the fact that i cant compile my friggin project when i add new files into the project.
Since we apaprantly dont use the regular Android.mk file anymore when we used eclipse and proj.android.
what file do i then change ?

Im using cocos2d-x 3.7
Im trying to compile the project in cmd with the line “cocos compile -p android --android-studio”

But it seems to not wnat to work once i try to add my own files.
Id love it if anyone could awnser this asap.

You need to add all you files to Android.mk.

Sample:

FILE_LIST += $(wildcard $(LOCAL_PATH)/../../Classes/*.c*)
FILE_LIST += $(wildcard $(LOCAL_PATH)/../../Classes/*/*.c*)
FILE_LIST += $(wildcard $(LOCAL_PATH)/../../Classes/*/*/*.c*)
LOCAL_SRC_FILES := $(FILE_LIST:$(LOCAL_PATH)/%=%)

Careful with this because if you forget to add hellocpp/main.cpp to LOCAL_SRC_FILES you get segmentation fault immediately when running your app, without any error message displayed during compilation (as of cocos2d-x3.9). See new issue on github

I actually couldn’t use wildcards and avoid linking errors at the same time. These all gave undefined references to AppDelegate constructor:

FILE_LIST += $(wildcard $(LOCAL_PATH)/…/…/Classes/*.cpp)
LOCAL_SRC_FILES := hellocpp/main.cpp
$(FILE_LIST:$(LOCAL_PATH)/%=%)

or:

FILE_LIST += $(wildcard $(LOCAL_PATH)/…/…/Classes/*.cpp)
LOCAL_SRC_FILES := $(FILE_LIST:$(LOCAL_PATH)/%=%)
hellocpp/main.cpp \

If someone knows how to use wildcards and add the hellocpp/main.cpp at the same time to LOCAL_SRC_FILES I’d be thankful see his solution.

i wants to add new cpp files in my cocos2d-x projects in android studio.For that there was one step to run Build_native.py file in cmd but i am unable to find Build_native.py file in android project directory,it is missing.

i created new project but still Build_native.py is not generating(show hidden files is enabled).i alter the version of NDK from 14-15 and Re-creat new project but still Build_native.py is missing…I am newbie at coocos so any help will be very appreciate…