Issues with Cocos2d-x v3.10. Problem compiling new project

I recently downloaded Cocos2d-x v3.10 from the cocos download page: http://www.cocos2d-x.org/download
On my Mac from the Terminal I went to the downloaded folder directory and ran

./setup.py 

Then made a new project using

cocos new MyGame -p com.game.name -l js

Then I plugged my Android phone to my laptop, moved into the game’s directory and ran

cocos run -p android

It took over 10 mins to finish compiling and then it ended with this

Building apk...
running: '/Applications/Cocos/tools/ant/bin/ant clean debug -f /Users/eliasfares/pxRepo/Dev/test/frameworks/runtime-src/proj.android/build.xml -Dsdk.dir=/Users/eliasfares/Cocos2d/Android/android-sdk-macosx'

/bin/sh: /Applications/Cocos/tools/ant/bin/ant: No such file or directory
Error running command, return code: 127.

Is this normal? Did I miss a step or do something wrong?

UPDATE
The PATH to the ant file was incorrect. I fixed it and it compiles/runs as expected now for android.

BUT for ios, the project runs when I open it in Xcode and click run (in an iPhone simulator) but when using the terminal/cocos console it doesn’t work. I get this:

** BUILD FAILED **

The following build commands failed:
	Libtool /Users/eliasfares/pxRepo/Dev/RockyRaceGame/simulator/ios/libcocos2d\ iOS.a normal i386
(1 failure)
Build failed: Take a look at the output above for details.

Thanks!

Did you run the setup.py script first?

Yes, I did run setup.py script first.
The new project did say Cocos v3.10.

In the terminal type ant -version … what you see?

Yup that was the problem. The PATH to the ant file was incorrect. I fixed it and it compiles/runs as expected now for android :smile:

BUT for ios, the project runs when I open it in Xcode and click run (in an iPhone simulator) but when using the terminal/cocos console it doesn’t work. I get this:

** BUILD FAILED **

The following build commands failed:
	Libtool /Users/eliasfares/pxRepo/Dev/RockyRaceGame/simulator/ios/libcocos2d\ iOS.a normal i386
(1 failure)
Build failed: Take a look at the output above for details.

Could the space in the libjscocos2d iOS.a file name be causing the error?

The space is not the issue. I ran cocos run -p ios on my iMac for the hello world & it works fine.

I know very little about iOS stuff …
:frowning:

Alright well it works when I run it from Xcode so I’ll just go with that and for Android I’ll run it through terminal.

Thanks for all your help!