我尝试运行cocos2dx示例程序,但是我得到以下错误路径或设置有问题吗?我很乐意听到你的消息!
Mic-no-MacBook-Pro:CocoFolder mic$ cocos run -s ~/Desktop/CocoFolder/NewGame -p android --android-studio
/Users/mic/.bash_profile: line 8: export: `PATH:/Users/mic/Downloads/adt-bundle-mac-x86_64-20140702/sdk:/usr/local/lib/node_modules/ant/ant/bin:/usr/local/lib/node_modules/ant/ant:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Users/mic/Desktop/CocoFolder/cocos2d-x-3.14.1/tools/cocos2d-console/bin:/Users/mic/Desktop/CocoFolder/android-ndk-r14b:/Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home:/usr/local/lib/node_modules/ant/ant:/usr/local/lib/node_modules/ant/ant/bin': not a valid identifier
/Users/mic/.bash_profile: line 11: export: `PATH:/Users/mic/Downloads/adt-bundle-mac-x86_64-20140702/sdk:/usr/local/lib/node_modules/ant/ant/bin:/usr/local/lib/node_modules/ant/ant:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Users/mic/Desktop/CocoFolder/cocos2d-x-3.14.1/tools/cocos2d-console/bin:/Users/mic/Desktop/CocoFolder/android-ndk-r14b:/Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home:/usr/local/lib/node_modules/ant/ant:/usr/local/lib/node_modules/ant/ant/bin': not a valid identifier
Building mode: debug
Using Android Studio project : /Users/mic/Desktop/CocoFolder/NewGame/proj.android-studio
running: '/Users/mic/Downloads/adt-bundle-mac-x86_64-20140702/sdk/tools/android update project -t android-13 -p /Users/mic/Desktop/CocoFolder/NewGame/proj.android-studio/app'
*************************************************************************
The "android" command is deprecated.
For manual SDK, AVD, and project management, please use Android Studio.
For command-line tools, use tools/bin/sdkmanager and tools/bin/avdmanager
*************************************************************************
Invalid or unsupported command "update project -t android-13 -p /Users/mic/Desktop/CocoFolder/NewGame/proj.android-studio/app"
这是在bash个人资料中
export ANT_HOME=/usr/local/lib/node_modules/ant/ant
export PATH=$ANT_HOME:$PATH
export ANT_ROOT=/usr/local/lib/node_modules/ant/ant/bin
export PATH=$ANT_ROOT:$PATH
export ANDROID_HOME=/Users/mic/Downloads/adt-bundle-mac-x86_64-20140702/sdk
export PATH:$ANDROID_HOME:$PATH
export ANDROID_SDK_ROOT=/Users/mic/Downloads/adt-bundle-mac-x86_64-20140702/sdk
export PATH:$ANDROID_SDK_ROOT:$PATH
export ANT_HOME=/usr/local/lib/node_modules/ant/ant
export PATH=$ANT_HOME:$PATH
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home
export PATH=$JAVA_HOME:$PATH
export NDK_ROOT=/Users/mic/Desktop/CocoFolder/android-ndk-r14b
export PATH=$NDK_ROOT:$PATH
export COCOS2D_CONSOLE_ROOT=/Users/mic/Desktop/CocoFolder/cocos2d-x-3.14.1/tools/cocos2d-console/bin
export PATH=$COCOS2D_CONSOLE_ROOT:$PATH
答案 0 :(得分:3)
data = "0"
无法正常工作,因为它还依赖于android.bat实用程序。
您正在使用Android SDK工具构建25.3.X版本,现在,android命令已经消失。 Android SDK工具发布说明here。 android命令&蚂蚁脚本被删除。
此解决方案是从此页面降级到以前版本(25.2.3)的SDK工具: https://developer.android.com/studio/index.html(参见页面底部) 然后将Android sdk中的tools文件夹替换为上一个。
另一个解决方案从GitHub repo(v3分支)下载cocos2d-console并删除所有文件,并在删除cocos2d-console文件夹的旧文件后放入/ cocos2d-x / tools / cocos2d-console文件夹。