访问我的个人博客 秋码个人博客
1、下载NDK
可从官网下载 https://developer.android.google.cn/ndk/downloads/index.html 但官网都是最新的,提供几个版本下载
r12b windows 32位
https://dl.google.com/android/repository/android-ndk-r12b-windows-x86.zip
64位
https://dl.google.com/android/repository/android-ndk-r12b-windows-x86_64.zip
Mac 64位
https://dl.google.com/android/repository/android-ndk-r12b-darwin-x86_64.zip
Linux 64位
https://dl.google.com/android/repository/android-ndk-r12b-linux-x86_64.zip
r11c windows 32位
https://dl.google.com/android/repository/android-ndk-r11c-windows-x86.zip
64位
https://dl.google.com/android/repository/android-ndk-r11c-windows-x86_64.zip
mac 64位
https://dl.google.com/android/repository/android-ndk-r11c-darwin-x86_64.zip
Linuc 64位
https://dl.google.com/android/repository/android-ndk-r11c-linux-x86_64.zip
r10e windows 32位
https://dl.google.com/android/ndk/android-ndk-r10e-windows-x86.exe
64位
https://dl.google.com/android/ndk/android-ndk-r10e-windows-x86_64.exe
mac 64位
https://dl.google.com/android/repository/android-ndk-r10e-darwin-x86_64.zip
Linux 64位
https://dl.google.com/android/repository/android-ndk-r10e-linux-x86_64.zip
r9d windows 32位
http://dl.google.com/android/ndk/android-ndk-r9d-windows-x86.zip
64位
http://dl.google.com/android/ndk/android-ndk-r9d-windows-x86_64.zip
mac64位
https://dl.google.com/android/ndk/android-ndk-r9d-darwin-x86_64.tar.bz2
Linux 64位
https://dl.google.com/android/ndk/android-ndk-r9d-linux-x86_64.tar.bz2
r8e windows 32位
https://dl.google.com/android/ndk/android-ndk-r8e-windows-x86.zip
64位
https://dl.google.com/android/ndk/android-ndk-r8e-windows-x86_64.zip
mac64位
https://dl.google.com/android/ndk/android-ndk-r8e-darwin-x86_64.tar.bz2
Linux 64位
https://dl.google.com/android/ndk/android-ndk-r8e-linux-x86_64.tar.bz2
r7d Windows 32位
https://dl.google.com/android/ndk/android-ndk-r7c-windows.zip
mac 64位
https://dl.google.com/android/ndk/android-ndk-r7c-darwin-x86.tar.bz2
Linux 64位
https://dl.google.com/android/ndk/android-ndk-r7c-linux-x86.tar.bz2
我用的是r9d 64位的
http://dl.google.com/android/ndk/android-ndk-r9d-windows-x86_64.zip
2、下载Android SDK
可从此处下载 http://tools.android-studio.org/index.php/sdk
因为使用eclipse 所以还要配置Android 插件 就是下载 ADT
3、下载ADT
http://tools.android-studio.org/index.php/adt-bundle-plugin
然后在eclipse配置下
然后在eclipse配置 AndroidSDK 和NDK所在路径
4、创建cocos2d-x项目
eclipse导入proj.android项目
然后拷贝 org/cocos2dx/lib到src下
右击项目属性
打开Android.mk文件进行 添加
$(call import-add-path,F:/BaiduNetdiskDownload/sanguo2.2.1/cocos2d-x-2.2.1/cocos2d-x-2.2.1)
$(call import-add-path,F:/BaiduNetdiskDownload/sanguo2.2.1/cocos2d-x-2.2.1/cocos2d-x-2.2.1/cocos2dx/platform/third_party/android/prebuilt)
因为使用 r9d 使用 在Android.mk 加了
APP_CPPFLAGS += -Wno-error=format-security
最后 run as application
模拟器启动有点慢 反正是运行成功了