Error!!! Please run in cocos2dx root.

Error!!! Please run in cocos2dx root.
0.0 0


Hi all,
I am quite new to cocos2dx and I am trying to set the engine up for both iPhone and Android development as a hybrid, however I am trying to setup the android project and keep getting the “Error! Please run in cocos2dx root.” which makes no sense as I am assuming the root folder is the cocos2dx folder in which create-android-project currently resides. I am also fairly new to mac as well however I feel it might be a lot cleaner developing both on mac.
I am using the terminal command bash and then entering the files directory for example,
“bash /Users/myname/Desktop/Android_Development/cocos2d-2.0-x-2.0.4/cocos2dx/” however run into the error.
Can someone please point out where I am going wrong?
Thanks in advance.

Hi have solved this issue by renaming the .sh file to a .command file hence making it run on double clicking the file. Had tried fruitlessly for hours with different paths, even though was in the root folder however this did the trick.

My apologies this turned out to be false as I made the change on instead of the….
Currently I still have the error.


You should perhaps run it from cocos root dir. That would be “/Users/myname/Desktop/Android_Development/cocos2d-2.0-x-2.0.4/cocos2dx” in your case.


You should cd first.

cd /Users/myname/Desktop/Android_Development/cocos2d-2.0-x-2.0.4/cocos2dx


Hi, I will try to “cd”. My apologies I am not sure of the terminology as I am mainly a windows user…
However strangely when I ran .command on the this works fine however regardless of what I do with (even changing the .sh to .command) I still have the error returned which is incredibly frustrating.
I will give your suggestion a try first.
Thanks in advance.


I have tried to cd as suggested however I still can not get the to run…
It is still returning the error! Please run in cocos2dx. Im completely clueless as to how to fix this.
Is there any alternatives to setting up a new cocos2dx android project manually?
Thanks in advance.


I have actually managed to get the project to build now thanks to AW and Lance Gray for giving me a hand.