Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What I am trying to do today is to import a full project to Android, but no tutorials are available for that that I have seen. My approach was to create a new android project, copy all the classes and resources in the folders and calling ./ but I get an error because most of the files are not being included in the project. I tried opening the and I can see why "LOCAL_SRC_FILES := AppDelegate.cpp \ HelloWorldScene.cpp" are the only files linked.

Should I manually modify the make file or can it be automated by some way I don't know?

Thank you.


I manually added all files and headers to the make file and I get errors linking Box2D or cocosdenshion libraries.

share|improve this question

just add every file with cpp extention in your project into "LOCAL_SRC_FILES list", and of course if you don't have a file named "HelloWorldScene.cpp", remove it from that list.


I'm not sure this time but I'm guessing from what I can see inside test project: there are two file with name ""

  1. jni\
  2. jni\tests\ (or equivalent address based on your project name)

in the first file add

subdirs := $(addprefix $(LOCAL_PATH)/../../../,$(addsuffix /, \
    Box2D \
    cocos2dx \
    CocosDenshion/android \

note that $(LOCAL_PATH)/../../../ should point at cocos2dx root folder change it if it is not correct

and in the second file this line should do the trick

    LOCAL_SHARED_LIBRARIES := cocosdenshion_shared box2d_shared
share|improve this answer
I just added an update: UPDATE: I manually added all files and headers to the make file and I get errors linking Box2D or cocosdenshion libraries. – MLProgrammer-CiM Mar 19 '12 at 13:12
@EfEs updated my answer. – Ali.S Mar 19 '12 at 14:13
I did test it, it correctly imports the libraries but I can't say it is the answer because I still get a lot of project-related problems, sorry :( – MLProgrammer-CiM Mar 19 '12 at 14:42
I tried using another build_native from previous version and everything looks like working, but I get realtime problems when calling System.loadLibrary("cocos2d"); If you want to help send me a message or we can talk in chat. Thanks. – MLProgrammer-CiM Mar 19 '12 at 14:51
The problem was that someone else had updated the libraries in the SVN under a different name. Question closed. – MLProgrammer-CiM Apr 1 '12 at 1:22
up vote 0 down vote accepted

The problem was the library naming, as the standard Android project has the library names as "cocos2d" (my project had cocos2dx) and "cocosdenshion" (case sensitive into "CocosDenshion")

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.