找到錯誤了,好像找到解決方法了,我試試
終于可以运行了:904:
不過還是提示
21:49:16 **** Incremental Build of configuration Release for project HelloWorld ****
python /Users/chankengsan/Documents/IOS/HelloWorld/proj.android/build_native.py -b release all
Please use cocos console instead.
COCOS_CONSOLE_ROOT not define. Please define COCOS_CONSOLE_ROOT in your environment!
21:49:18 Build Finished (took 2s.276ms)
我在.bash_profile設了COCOS_CONSOLE_ROOT的
我的报这个错 还有救么?
python E:/girlshow/proj.android/build_native.py -b release all
Process Process-1:
Traceback (most recent call last):
File “D:\Program Files\Python27\lib\multiprocessing\process.py”, line 250, in _bootstrap
sys.stdin = open(os.devnull)
IOError: No such file or directory: ‘nul’
Process Process-2:
Traceback (most recent call last):
File “D:\Program Files\Python27\lib\multiprocessing\process.py”, line 250, in _bootstrap
sys.stdin = open(os.devnull)
IOError: No such file or directory: ‘nul’
Process Process-3:
Traceback (most recent call last):
File “D:\Program Files\Python27\lib\multiprocessing\process.py”, line 250, in _bootstrap
sys.stdin = open(os.devnull)
IOError: No such file or directory: ‘nul’
Running command: compile
Building mode: release
ANT_ROOT not defined. Please define it in your environment
Please use cocos console instead.
Traceback (most recent call last):
File “E:/girlshow/proj.android/build_native.py”, line 43, in
build(opts.build_mode)
File “E:/girlshow/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 E:\girlshow\proj.android…/ ] fails!
00:06:14 Build Finished (took 1s.453ms)
为什么我创建的新项目都没有那个.py的文件。 环境是安装好的,能把他的列子打包成功。 求方法
照着这个方法做了,还是出现这样的问题:
**** Build of configuration Release for project CocosProject ****
python /Users/Zakim/Documents/CocosProjects/CocosProject/proj.android/build_native.py -b release all
Running command: compile
Building mode: release
Updated project.properties
Updated local.properties
Updated file /Users/Zakim/Documents/CocosProjects/CocosProject/proj.android/proguard-project.txt
It seems that there are sub-projects. If you want to update them
please use the --subprojects parameter.
Android platform not specified, searching a default one…
running: ‘/Users/Zakim/Documents/adt-bundle-mac-x86_64-20131030_1/sdk/tools/android update project -t android-19 -p /Users/Zakim/Documents/CocosProjects/CocosProject/proj.android’
building native
NDK build mode: release
NDK_TOOLCHAIN_VERSION: 4.9
Ndk build failed!
Traceback (most recent call last):
Please use cocos console instead.
File “/Users/Zakim/Documents/CocosProjects/CocosProject/proj.android/build_native.py”, line 46, in
build(opts.build_mode)
File “/Users/Zakim/Documents/CocosProjects/CocosProject/proj.android/build_native.py”, line 30, in build
raise Exception(“Build dynamic library for project " + app_android_root + " ] fails!”)
Exception: Build dynamic library for project /Users/Zakim/Documents/CocosProjects/CocosProject/proj.android/…/ ] fails!
**** Build Finished ****
我的build_native.py文件如下:
#!/usr/bin/python
build_native.py
Build native codes
Please use cocos console instead
import sys
import os, os.path
import shutil
from optparse import OptionParser
def build(build_mode):
current_dir = os.path.dirname(os.path.realpath(__file__))
cocos_root = os.path.join(current_dir, "../cocos2d")
app_android_root = os.path.join(current_dir, "../")
if build_mode is None:
build_mode = 'debug'
elif build_mode != 'release':
build_mode = 'debug'
COCOS_CONSOLE_ROOT = os.environ'COCOS_CONSOLE_ROOT']
command = '%s/cocos compile -p android -s %s -m %s' % (COCOS_CONSOLE_ROOT, app_android_root, build_mode)
if os.system(command) != 0:
raise Exception("Build dynamic library for project " + app_android_root + " ] fails!")
-------------- main --------------
if name == ‘main’:
parser = OptionParser()
parser.add_option("-n", "--ndk", dest="ndk_build_param", help='it is not used', action="append")
parser.add_option("-p", "--platform", dest="android_platform",
help='it is not used')
parser.add_option("-b", "--build", dest="build_mode",
help='the build mode for java project,debug or release.Get more information,please refer to http://developer.android.com/tools/building/building-cmdline.html')
(opts, args) = parser.parse_args()
print "Please use cocos console instead.\n"
build(opts.build_mode)
请教各位大神呀~求帮忙呀~是在自己解不了!
看到一个一样的错误 仁兄你解决了没!!
我把 cocos 的绝对路径 写到那个 build_native.py 文件里,居然可行。
整天改个毛 槽