Easy Guide to setup the cocos2d-x for android in Windows

Easy Guide to setup the cocos2d-x for android in Windows
0.0 0


Hi Nguyen, don’t you had the second problem I mentioned? I am stuck in that problem. :confused:


I solve the problem. Its that it’s not possible to copy the game folder to another place, like is implicit in the ninth step. It shall be kept in the original place that create script place it.



:slight_smile: Thank you for the tutorial.
And at the Cygwin building step. I have a trouble and sincerely need your help.
I wrote a topic here.

Thank you ! :slight_smile:


Thank you so much for this thread. I just managed to get the hellocpp project running on my android from eclipse.

There is also one more problem that’s not mentioned in this thread and it’s to do with the ‘Function/Method xyz not resolved’ error given by the code analysis. Solution here:

Basically you go into project properties and downgrade the error to a warning.


As cygwin will not longer be used (http://www.cocos2d-x.org/issues/2834), I think the setup will no longer appropriate in latest version

For vs-android, our issues are complicated because I included boost library in solution. Also there are macro definition such as “WIN32” required to remove. I will try to create a small build from new cocos2d project first.:slight_smile:



First of all thanks for guide.

Also I must add, if anyone encounters with an error on CCFileUtilsAndroid that finishes within “android-ndk-r8-crystax-1/build/core/build-binary.mk:320: reci pe for target ‘obj/local/armeabi/objs/cocos2dx_static/platform/android/CCFileUti lsAndroid.o’ failed
make: * [obj/local/armeabi/objs/cocos2dx_static/platform/android/CCFileUtilsAn droid.o] Error 1
make: Leaving directory ‘/cygdrive/d/AndDev/cocos2d-x-2.2/projects/HelloAndroid/ proj.android’”

Go to:

and include fstream in




I am new to cocos2d-x.I am setting Cocos2d-x for windows. When I am opening the hello.cpp project in Eclipse-ADT it is giving me the error (program “make” is not found in path).


These guides written in this forum don’t make any sense and I don’t even know if they work.
If you’d like to read an easy to follow guide that works.

Install MinGW from the guide below. This will take care of compiling the C/C++ code (with bash) for you with Gnu. Remember that Windows requires you to log out and back in after you make changes to the Path in environment variables.

Download Eclipse if you didn’t already.
In Eclipse update the SDK, Window->SDK Manager
NOTE You should use a real Android device plugged in via USB because Cocos2dx requires OpenGL which doesn’t run easily via the emulator. Make sure you check “Use Host GPU” if you do use an emulator. For me, the biggest hurdle in using Windows to do Android development with Cocos2d is to get Windows to recognize my Android device on USB properly.

Download Cocos2d-x-2.2.2, example path, "c:/development/projects/cocos2d-x-2.2.2"
Download Android NDK, example path, “c:/development/lib/android/ndk”

Open Eclipse

Eclipse preferences (for all Cocos2d related projects)
Eclipse->Preferences->General->Workspace->Linked Resources->NEW
-set “COCOS2DX” to the path we chose above “c:/development/projects/cocos2d-x-2.2.2"
Eclipse->Preferences->C/C++ > Build > Environment > ADD
-set “NDK_ROOT” to the path we chose above"c:/development/lib/android/ndk”

Create a workspace for your Cocos2d Project.
Choose new “Android Project from Existing Code” (I had to select “other” to see this option)
You’ll need to include this project to get cocos2d-x.

Now you may create your Cocos2dx project, or add a sample project:
Choose new “Android Project from Existing Code”

Note: at this point you should have 2 projects in your Workspace. Click on the second one, ex: MoonWarriors and then press Run (after you plug in your device or setup an emulator).


Hjcc fix error for me, pls :frowning:

Tran@AmateurTran ~

Tran@AmateurTran /cygdrive/c/Cocos2D-X/cocos2d-x-2.2.2
$ python
-bash: python: command not found

Tran@AmateurTran /cygdrive/c/Cocos2D-X/cocos2d-x-2.2.2
$ cd tools/project-creator

Tran@AmateurTran /cygdrive/c/Cocos2D-X/cocos2d-x-2.2.2/tools/project-creator
$ python ./create_project.py -project TestGame -package com.MyCompany.TestGame -language cpp
-bash: python: command not found

Tran@AmateurTran /cygdrive/c/Cocos2D-X/cocos2d-x-2.2.2/tools/project-creator

OS: window 8 64 bit


Anyone can help me, i cannot find gcc-g**, gcc4-core, gcc4-g**, from cgywin installation.
Please help.


Thank, save my day