##Easy Run cocos2d-x-3.x in Eclipse
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 cocos2d-x-3.0/templates/cpp-template-default
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 NDK_ROOT
- Eclipse->Preferences->C/C++->Build->Environment.
- Click Add button and add a new variable
NDK_ROOT
pointing 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 !!!
###Ant Build
You need download ant at first,also confim you have install correct android sdk version where target set in project.properties
.
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
-
Perfect Indexer!
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.
- Android Proguard support
- NDK debug support
You can fork this template at My Github.