Skip to content
No description, website, or topics provided.
Python Java C++
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

##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 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 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. Example

####Step 2: Adding and running from Eclipse



  1. File->New->Project->Android Project From Existing Code
  2. Browse to your project directory and Add the project
  3. 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

1. ./  target
2. ./cocos2d/cocos2d/cocos/2d/platform/android/java/ target

ant -file build.xml -Dsdk.dir=/Your/Android/sdk/path clean debug


  1. No errors on Editor

    closed eclipse Code Analysis's error option

  2. Perfect Indexer!

    Add two symbols at Eclipse's c++ General settings

  3. Auto find cpp files can auto find cpp files from Classes and jni directory.

  4. Add libcocos2d as a link directory

    you need not to add libcocos2d any more.

  5. 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

  1. Android Proguard support
  2. NDK debug support

You can fork this template at My Github.

You can’t perform that action at this time.