Skip to content

Instantly share code, notes, and snippets.

@junaidk
Last active December 17, 2015 23:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save junaidk/5693223 to your computer and use it in GitHub Desktop.
Save junaidk/5693223 to your computer and use it in GitHub Desktop.
Cocos 2dx setup
##import into eclipse
(http://stackoverflow.com/questions/12654078/cocos2d-x-android-cant-resolved-coscos2dx-library)
In cocos2d-x 2.0.3 ...Cocos2d-x Lib java files has been considered as a different project only So import that project in the eclipse
Lets make it Simple
First Import the project in eclipse from this path - cocos2d-2.0-x-2.0.3/cocos2dx/platform/android/java
You will see libcocos2dx project in eclipse ...Keep this project open always otherwise your projects will give error on the syntax of library
Run create-android-project
Now Import the project which you have created and just Run (If you know the concept of isLibrary then that's how they are maintaining it now ..)
Also additional information to run build-native.sh from eclipse only , Right Click Project ->C/C++ Build Uncheck Use Default Build COmmand and add following bash ${workspace_loc:/YourProjName}/build_native.sh NDK_DEBUG=1 V=1
Good Luck ..If any question please feel free to ask
#trouble shooting:
1. AVD : api level 15 or 17 ( preffer 17)
2. emmulate gpu
#change libgame to game like that
static {
System.loadLibrary("game");
}
# link the folder of libcocos2dx to project not link as library
properties>sources>link (C:\development\cocos2d-x-develop\cocos2dx\platform\android\java)
# if there is some make error like "no build target defined " then
delete obj folder and also all folders from libs and try to build..
http://stackoverflow.com/questions/14313349/cocos2d-x-for-android-symbol-cocos2d-could-not-be-resolved
http://www.raywenderlich.com/33750/cocos2d-x-tutorial-for-ios-and-android-getting-started
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment