##Easy Run cocos2d-x-3.0 in Eclipse
New!! The code Most of this template has pull request to cocos2d-x origin, and have merged after v3.1. But you can still use it by more features.
Cocos2d-x Official's Android project template is incorrect. so,I fix it, You can easy run cocos2d-x-3.x in eclipse by two steps !!!
At first, you should download this template and replace the incorrect template at
You also can use it for lua/js projects by a little change.
- Android NDK
- Android SDK OR Eclipse ADT Bundle
- Android AVD target installed
- Command line Building project successed
You can read official README.md to finish it
####Step 1: C/C++ Environment Variable
- Click Add button and add a new variable
NDK_ROOTpointing to the root NDK directory.
####Step 2: Adding and running from Eclipse
- File->New->Project->Android Project From Existing Code
- Browse to your project directory and Add the project
- Click Run as Android Application to run on connected device or emulator.
That's all !!!
You need download ant at first,also confim you have install correct android sdk version where target set in
1. ./proj.android/project.properties target 2. ./cocos2d/cocos2d/cocos/2d/platform/android/java/project.properties target
ant -file build.xml -Dsdk.dir=/Your/Android/sdk/path clean debug
No errors on Editor
closed eclipse Code Analysis's error option
Add two symbols at Eclipse's c++ General settings
Auto find cpp files
Android.mk can auto find cpp files from Classes and jni directory.
Add libcocos2d as a link directory
you need not to add libcocos2d any more.
Support STL Indexer
I use gun-libc++ 4.8, you can change it at Project->Properties->Paths and Symbols->Includes if you do not have this version.
To do List
- Android Proguard support
- NDK debug support
You can fork this template at My Github.