I’m getting this error with Eclipse: sh: cocos: command not found
Console output:
**** Build of configuration Release for project ProjectName ****
python /Users/username/Development/CocosProjects/ProjectName/proj.android/build_native.py -b release all
sh: cocos: command not found
Please use cocos console instead.
Traceback (most recent call last):
File “/Users/username/Development/CocosProjects/ProjectName/proj.android/build_native.py”, line 43, in
build(opts.build_mode)
File “/Users/username/Development/CocosProjects/ProjectName/proj.android/build_native.py”, line 28, in build
raise Exception(“Build dynamic library for project [ " + app_android_root + " ] fails!”)
Exception: Build dynamic library for project [ /Users/username/Development/CocosProjects/ProjectName/proj.android/…/ ] fails!
**** Build Finished ****
NDK: n9d
Cocos2d-x: 3.5
The project is running normally with “cocos run -p android” and with xcode for iOS
He’s right !! Go to 3.4, cuz I don’t know why but just I’ve just succeeded to built 2 times with the 3.5 (“OS X 10.10, Eclipse Luna”), I think that’s a f*cking random error that happened 9/10 times, but I don’t really know wtf?!? ^^
Maybe it will be fixed in the 3.6…
Hi all ! I have same problem and solved it ! I spend 1 day to know why
I used cocos2d 3.5, python 2.79, ant .1.9.4, ndk 10d. The first i run download-deps.py and then setup.py. Remember path for ANT_ROOT = your ant path/bin
I used cocos2dx 3.5, python 2.7.6, ant .1.9.4, ndk 10d. The first i run download-deps.py and then setup.py. path for ANT_ROOT . But the Problem not slovel,please help me
hi, you delete folder obj and clean project again !
i have idea : if you used cocos old versions, before(3.5) you can build project with eclipse, if you used 3.5, you should build project with cmd(command prompt) : “cocos run -p build debug”
ps: for cocos 3.5 if you want build project with eclipse, you can copy file build_native.py from old version to new version 3.5
In eclipse also define ANT_ROOT and ANDROID_SDK_ROOT in project->properties->C/C++ Build-> Environments
After you do all the above, you pass the error but you will only get the result: “Please use cocos console instead”
==> build NDK from cmd “python build_native.py -b release” in terminal.
==> and then you can continue the “native-android-side” code and build .apk in eclipse.