标签:准备 android The 重启 运行 new t undle sdk www.
下载最新3.17稳定版cocos2d-x:
http://www.cocos2d-x.org/download
下载Android Studio,更新到最新版3.2.1。
在Android SDK设置里,勾选NDK最新版18.1.5063045
例如:
export ANDROID_SDK_ROOT=/home/guifeng/Android/Sdk
export NDK_ROOT=/home/guifeng/Android/Sdk/ndk-bundle
# Add environment variable COCOS_CONSOLE_ROOT for cocos2d-x
export COCOS_CONSOLE_ROOT="/home/guifeng/git/cocos2d-x-3.17/tools/cocos2d-console/bin"
export PATH=$COCOS_CONSOLE_ROOT:$PATH
# Add environment variable COCOS_X_ROOT for cocos2d-x
export COCOS_X_ROOT="/home/guifeng/git"
export PATH=$COCOS_X_ROOT:$PATH
# Add environment variable COCOS_TEMPLATES_ROOT for cocos2d-x
export COCOS_TEMPLATES_ROOT="/home/guifeng/git/cocos2d-x-3.17/templates"
export PATH=$COCOS_TEMPLATES_ROOT:$PATH
# Add environment variable ANT_ROOT for cocos2d-x
export ANT_ROOT="/usr/share/ant/bin"
export PATH=$ANT_ROOT:$PATH
通过新建游戏,编辑游戏除错
cocos new THEGAME -p com.guifeng.THEGAME -l cpp -d THEGAME_PROJECT
cd THEGAME_PROJECT
cocos run -p linux
Android Studio 提示/dev/kvm权限问题,可通过把当前用户加入kvm组,重启后解决。
我主要遇到找不到GLEW、GTK3的错误,可以进入linux-build目录,运行cmake ..,查看报错。
我的错误可通过安装libglfw3-dev libgtk-3-dev解决
Ubuntu 18.04.1 LTS安装cocos2d-x 3.17简记
标签:准备 android The 重启 运行 new t undle sdk www.
原文地址:https://www.cnblogs.com/gfzheng/p/10125383.html