Run & debug cocos2dx 2.2.6 project on Android Studio

Run & debug cocos2dx 2.2.6 project on Android Studio


I have an old cocos2dx 2.2.6 project running on eclipse and I manage to move it to android studio by the following steps:

  1. Download or clone the following repository

  2. Update CCGLProgram.cpp to run app on android studio emulator.

  1. After run and debug this sample application I’ve changed the package name to my app package name.

  2. Transfer my project to the new structure as following:

  • Copy and replace classes folder and resources folder with mine.

  • Copy and replace to proj.androidstudio / [app name] / app / jni

  • Copy to proj.androidstudio / [app name] / app / res

  • Copy…/Resources to proj.androidstudio / [app name] / app / assets

  • Copy [Top Directory] to proj.androidstudio / [app name] / app / src / [same folder name as src]

  • Then regenerate my file using AndroidMakeGenerator as shown here

  • build and add required dependencies one by one.

Cocos2dx v2.2.6 migration to Android studio