Edit the Android.mk file and replace it with the following:
Local_path: = $ (PagerMy-dir) Local_path: = $ (PagerMy-dir) include $ (clear_vars) Local_module: = cocos2dcpp_shared local_module_filename: = libcocos2dcpp FILE_LIST: = h Ellocpp/main.cppfile_list + = $ (wildcard $ (local_path)/.. /.. /classes/*.cpp) Local_src_files: = $ (file_list:$ (local_path)/%=%) Local_c_includes: = $ (Local_path)/. /.. /classes Local_whole_static_libraries + = cocos2dx_staticlocal_whole_static_libraries + cocosdenshion_staticLOCAL_ Whole_static_libraries + = box2d_staticlocal_whole_static_libraries + chipmunk_staticlocal_whole_static_libraries + = Cocos_extension_static include $ (build_shared_library) $ (Pagerimport-module,cocos2dx) $ (Pagerimport-module,cocos2dx/platform/third_party/android/prebuilt/libcurl) $ (Pagerimport-module,cocosdenshion/android) $ (Pagerimport-module,extensions) $ (Pagerimport-module,external/box2d) $ (PagerImport-module,external/chipmunk)
In the above script
file_list: = hellocpp/main.cppfile_list + = $ (wildcard $ (local_path)/. /.. /classes/*.cpp) Local_src_files: = $ (file_list:$ (local_path)/%=%)
These three lines solve the problem of having to modify the Android.mk file once every time a class file name is added or modified.
Cocos2d-x avoid manually modifying android.mk files to compile