I’m on a fresh coco2d x Android Studio project which works fine. Now I want to refract the HelloWorldScene.cpp/h by my own class Game.cpp/h.
So I do a refractor from HelloWorldScene to Game. In these files lot of red color appears.
And a message occurs:
“This file is not part of the project. Please include it in the appropriate file (build.gradle, CMakelists.txt or Android.mk etc) and sync the project.”
The problem is I dont know which file to edit for fix that. And this error prevents me from compiling.
@doums well you can do it like this,
Remove LOCAL_SRC_FILES & add below 2 lines, FILE_LIST := $(wildcard $(LOCAL_PATH)/../../Classes/*.cpp) LOCAL_SRC_FILES := $(FILE_LIST:$(LOCAL_PATH)/%=%)
BUT
it will consider all your cpp files, so if you put some backup files in same folder then you have the problem.
choice is yours.
Yes I know this trick, used sometimes in my makefile to select all files depends the pattern. But like you said it’s not safe and clean. But interesting to know it also works on Android. mk file. Thanks you.