This is a bug I’ve faced & fixed my self but I still post it here for people who might stuck with it.
I’m brand new to both Cocos-x framework & Cocos Creator. I’ve just learnt to use them 2 days ago.
Yesterday I tried building an android test project entirely using Cocos Creator & Cocos-x v3.9 Framework (Of course I’ve set up python, android_ndk & sdk before already).
It was OK with “Build” function, but the next step “Compile” stopped with an error (Found in “nativeLog.txt”):
Running '“C:\somePath\Cocos-xV3.9\TOOLS\ANT” clean release “…\build.xml”
Error: “C:\somePath\Cocos-xV3.9\TOOLS\ANT” is not recognized as internal or external command …
While “TOOLS\ANT” is a folder extracted from “Cocos-x Framework V3.9” for windows.
I’ve googling for hours but no one has faced this problem like me. All promising suggestions turned to tell me to set “Environment Variables” named “ANT_HOME” or “ANT_ROOT” or “Path”. But none of the suggestions did the trick.
So here is the solution I’ve made that kicked the rock:
Just copy all files in folder “\Tools\Ant\Bin” into its parent folder “\Tools” and things will works properly.
The problem is that “TOOLS\ANT” is a folder, after you move the files, “TOOLS\ANT” refers to “TOOLS\ANT.CMD”.
I don’t know why Cocos Creator Compiler tools doesn’t add “\Bin\Ant.cmd” to the “Ant Path” in “Cocos Creator --> Preferences --> Native Develope” - Maybe it’s a mistake.