Cocos2d-x is a multiplatform game framework. It is a reimplementation of Cocos2D for iPhone in C++.

The main idea about it is that you are going to write plain old C++ code and that code will run on both Android (via JNI thanks to the NDK) and iPhone. It also has support for Win32, WoPhone and some other platforms, check them out on the Cocos2D-X website.

The zip that you can download from the project’s website includes wizards/helpers for creating a new project for each of the supported platforms, but it doesn’t have a wizard that will let you specify what platforms do you want to work on and then generate everything from one shot.

I took some time and figured out a way to manually create one of these hybrid projects for Android and iOS. This article is actually based on an edited version of an older article of mine which addressed an older version of cocos2dx and mainly assumed that you were using Xcode 3.


This tutorial uses the cocos2d-1.0.1-x-0.11.0 release. I will try to keep the guide updated as new versions are launched, but I could really use your help in the comments section in case I miss something specific to a new version.

The first thing you need to do is set up your system paths. This is what my .bash_profile looks like:

export ANDROID_NDK_ROOT=~/Development/AndroidNDK/
export COCOS2DX_ROOT=~/Projects/Cocos2d-x/
export NDK_ROOT=~/Development/AndroidNDK/
export ANDROID_SDK_ROOT=~/Development/AndroidSDK/

Some parts of Cocos2D-x reference ANDROID_NDK_ROOT, some NDK_ROOT. Be as it may, we define both of them and add the path to the system path.

In order to create the hybrid project we will follow the steps below:

  1. create the iPhone project
  2. create the Android project
  3. merge the Android project into the iPhone project

Creating the iPhone project

Cocos2D-x provides a bunch of templates for both XCode3 and 4 that will create the project along with all that is needed. We will use the Xcode 4 templates in this tutorial, although I like the Xcode3 templates better.

To install the templates fire up a Terminal, navigate to the Cocos2D-x directory:


In order to install the templates you need to have root privilege, so we will call:

sudo ./

The terminal will then ask you what to install:

cocos2d-x template installer
select the template version to install
3 for xcode3
4 for xcode4
input nothing for all

If you have both XCode3 and 4 installed, just hit enter, otherwise hit 4 for the XCode 4 templates.

Once you’ve done this, start up XCode and create a new project:

I called my new project SimpleGame so the next few examples will feature this name.

You should build and run your project now to make sure that it works properly.

A few considerations about the iPhone project

The main difference between creating an iPhone project first as opposed to an Android project is that the iPhone template will copy over and integrate the some of the Cocos2D-x framework in the project’s structure, while Android will just keep a reference to it. Android projects by default are designed to be kept inside the Cocos2D-x folder.

Creating the Android project

In the terminal get to the Cocos2D-x folder and type the following:


You will then be asked for a package path:

Input package path. For example: org.cocos2dx.example

Use something like org.cocos2dx.simplegame.

Then the wizard will ask you for the Android version that you want to support. Android 2.1 is a good choice:

Now cocos2d-x suppurts Android 2.1-update1, 2.2, 2.3 & 3.0
Other versions have not tested.
Available Android targets:
id: 5 or "android-7"
Name: Android 2.1-update1
Type: Platform
API level: 7
Revision: 2
Skins: HVGA (default), QVGA, WQVGA400, WQVGA432, WVGA800, WVGA854
id: 7 or "android-8"
Name: Android 2.2
Type: Platform
API level: 8
Revision: 2
Skins: HVGA (default), QVGA, WQVGA400, WQVGA432, WVGA800, WVGA854
id: 9 or "android-9"
Name: Android 2.3
Type: Platform
API level: 9
Revision: 1
Skins: HVGA (default), QVGA, WQVGA400, WQVGA432, WVGA800, WVGA854
input target id:

To select Android 2.1 in this case, type 5 and hit enter (the numbers vary based on your installed Android SDK versions). You will then be asked for the project name:

input your project name:

Type SimpleGame and hit enter. A new folder will be created with this name in the Cocos2D-x directory and the project files will be copied inside.

Careful if you created the iPhone project and saved it in the Cocos2d-x folder – it may get overwritten. The best bet is to make sure that no other folders with the same name exist in here.

And to see if it really worked you can make a build:

If it all works out without any errors we are now ready to move to the last step.

Merging the Android project into the iPhone project

When we will be done with this chapter, the structure of the game should be something like this:

First, we are going to create a makefile to help us test if the Android build script is still working properly.

Fire up the editor of choice and create a file named makefile in the android subdirectory of the Cocos2d-x/SimpleGame folder:

nano $COCOS2DX_ROOT/SimpleGame/android/makefile

Type in:

rm -rf libs/
rm -rf obj/

To exit and save, hit Ctrl+X, type Y, and then hit Enter. From now on, calling make clean in the Android directory will delete the already compiled binaries.

Do it now to clean up the compiled libraries from the previous step:

cd $COCOS2DX_ROOT/SimpleGame/android
make clean

Copying over the Android specific files to the main project

The actual merging will consist of copying over some of the folders from the Android directory, adjusting some values in the script and modifying a file from the iPhone project.

First, copy the android folder from $COCOS2DX_ROOT/SimpleGame/android/ to the iPhone project directory, next to the ios folder (the final path would be SimpleGame/SimpleGame/android/).

Second, copy the file from $COCOS2DX_ROOT/SimpleGame/Classes/ to SimpleGame/SimpleGame/Classes.

Third, copy the file from $COCOS2DX_ROOT/cocos2dx/ to SimpleGame/SimpleGame/libs/cocos2dx/.

Fourth, copy the android folder from $COCOS2DX_ROOT/CocosDenshion to SimpleGame/SimpleGame/libs/CocosDenshion/.

Finally, copy the platform folder from $COCOS2DX_ROOT/cocos2dx/platform to SimpleGame/SimpleGame/libs/cocos2dx/.

Sure, this will copy over the win32, marmalade, linux and other folders as well, but unless you want to hunt and peck through the folders to figure out what you need and what you don’t, just trust me on this one and copy all of them over.

Editing the Android makefile paths

Then edit the android/ file and update the following paths:

# set params

Next, open up the android/jni/ file and make it look like the following:

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)

subdirs := $(addprefix $(LOCAL_PATH)/../../libs/,$(addsuffix /, \
           cocos2dx \
           CocosDenshion/android \
subdirs += $(LOCAL_PATH)/../../Classes/ $(LOCAL_PATH)/helloworld/

include $(subdirs)


Next, open up the android/jni/helloworld/ file and make it look like the following:

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)

LOCAL_SRC_FILES := main.cpp

LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../libs/cocos2dx \
                    $(LOCAL_PATH)/../../../libs/cocos2dx/platform \
                    $(LOCAL_PATH)/../../../libs/cocos2dx/include \

LOCAL_LDLIBS := -L$(call host-path, $(LOCAL_PATH)/../../libs/$(TARGET_ARCH_ABI)) \
                -lcocos2d -llog -lgame_logic


What we have done is basically update the relative paths to match our folder structure — instead of going all the way to the folder above our project folder (the old cocos2dx installation directory), we go to the root of our project and then enter the libs folder.

Finally, open up the Classes/ file and update the paths once more to match the following:

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := game_logic

LOCAL_SRC_FILES := AppDelegate.cpp \

LOCAL_C_INCLUDES := $(LOCAL_PATH)/../libs/cocos2dx \
                    $(LOCAL_PATH)/../libs/cocos2dx/platform \
                    $(LOCAL_PATH)/../libs/cocos2dx/include \
                    $(LOCAL_PATH)/../libs/CocosDenshion/include \

LOCAL_LDLIBS := -L$(call host-path, $(LOCAL_PATH)/../android/libs/$(TARGET_ARCH_ABI)) \
                -lcocos2d -lcocosdenshion \
                -L$(call host-path, $(LOCAL_PATH)/../libs/cocos2dx/platform/third_party/android/libraries/$(TARGET_ARCH_ABI)) -lcurl

Now go to the android folder and type in the terminal

make clean

This will delete all the previously compiled libs and objs so they can be rebuilt by the build script. This is important! If you don’t clean up the already built libraries they won’t be deleted and the build script will complain that there’s “no rule to make target”.

Finally, type from the android folder in the terminal and have it successfully compile.

Each and every time you want to deploy an APK to an Android device (or virtual device) make sure you clean the project from inside Eclipse (Go to Project > Clean) and then right click the project and Run As > Android Application

Cleaning the project will force Eclipse to refresh the bundle files and take into account the newly compiled code when creating the game APK.

Optional: cleaning the platform folder

The platform folder inside the libs/cocos2dx is somewhere around 115MB. Unless you want to pollute your versioning system with a lot of unnecesssary files, I suggest you clean up that folder before committing.

To do that, open up the libs/cocos2dx/platform path and delete all the folders except for ios, android and third_party. You should NOT delete any of the files however.

Next, enter the libs/cocos2dx/platform/third_party folder and delete all the existing folders except for android and ios. This should clear you up about 50 MB of space.

Tagged with:  

49 Responses to Creating an iPhone and Android Cocos2D-x hybrid project (updated)

  1. [...] post has been updated with the latest version of Cocos2D-x here: Creating an iPhone and Android Cocos2D-x hybrid project (updated). Unless you have a very specific reason to use an older version of the library, please use the [...]

  2. Pablo says:

    Hello I´m following the tutorial but I had some problem executing $COCOS2DX_ROOT/SimpleGame/android/

    Show a lot of errors with CCConfiguration.h

    This is one example:
    /Users/MyUser/Projects/Cocos2d-x/SimpleGame/android/jni/../../../cocos2dx/CCConfiguration.cpp:90: error: ‘glGetString’ was not declared in this scope

    And this is the last error:
    make: *** [/Users/MyUser/Projects/Cocos2d-x/SimpleGame/android/obj/local/armeabi/objs-debug/cocos2d/CCConfiguration.o] Error 1

    Do you have some idea why is occurring this?

    Thanks in advance!

    • Pablo says:

      I have resolved that just trying with NDK of the MacOSX because I was trying with Windows NDK instead.

      Now I have a problem because I want to use Box2D and I don´t know how carry that.

      Any suggestion??

      Thanks in advance.

  3. Régis says:

    Thanks a lot for this brillant tutorial! I have got the following error when I compile:

    *** No rule to make target `jni/../../libs/cocos2dx/platform/CCFileUtils.cpp’, needed by `obj/local/armeabi/objs-debug/cocos2d/platform/CCFileUtils.o’. Stop.

    Any idea to solve this problem? Thanks !!

    • clw says:

      Looks like the file’s not there. Have you copied the platform folder into the cocos2dx folder?

      It’s this step:
      Finally, copy the platform folder from $COCOS2DX_ROOT/cocos2dx/platform to SimpleGame/SimpleGame/libs/cocos2dx/.

      You should try navigating to android/jni and typing out ls ../../libs/cocos2dx/platform/. If you’re not seeing the CCFileUtils.cpp file there it means that you need to copy the platform folder over.

      • Régis says:

        Thanks for your very quick reply! Actually, I had a doubt on the location where to copy the folder: do I have to replace the platform folder which is already here? (containing some CC files and an iOS folder) I initially thought that I had to copy $COCOS2DX_ROOT/cocos2dx/platform/android to SimpleGame/SimpleGame/libs/cocos2dx/platform/android… Do you confirm that this is wrong and that I have to replace the already existing platform folder? Thanks a lot for your help!

        • clw says:

          You can safely replace that folder with the one from the cocos2dx root location as it already contains the ios files as well.

          • Régis says:

            Thanks! I am blind…I didn’t see that this folder contains an iOS folder… Last question (I hope): I now get the following error:

            SharedLibrary :
            /Applications/Android/android-ndk-r7/toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/bin/ld: cannot find -lcurl
            collect2: ld returned 1 exit status
            make: *** [obj/local/armeabi/] Error 1

            Any idea? Thanks again!

  4. Régis says:

    Hi again !

    I am now trying to convert a full game developed with XCode to an hybrid project in order to be able to port it to Android (via Eclipse). Nevertheless, I have got some problems to do this and I asked the following question on stackoverflow (and made some advertising for your article/blog :)): Are you able to answer this question ? Thanks again for your great tutorial!!

    • clw says:

      Replying here as well so people can find the answer faster:

      From the looks of it you need to add your custom created files to Classes/ in the LOCAL_SRC_FILES section like this:

      LOCAL_SRC_FILES := AppDelegate.cpp \
      HelloWorldScene.cpp \
      IntroMenu.cpp \
      GameLayer.cpp \

      You need to do this in order to let the android build file know about the new files which need to be included in the build process.

      You will need to do this, afaik, for each new source file that you add to the project.

  5. Régis says:

    I asked a question close to the topic mentioned in this article: If you have got any ideas to answer it, don’t hesitate ! :)

    • Régis says:

      Thanks for your answer on ; I did what you recommend and…same error! Have a look to my answer on Cocos2d-x forum… This is driving me crazy!

  6. Greg says:

    Thanks man, It’s a great tutorial!

  7. jason says:

    What version of Eclipse are you using? I can’t get any of the android projects produced with to import as a project into Eclipse (using select root directory, no projects are recognized). Currently running Mac 10.6 with Eclipse Classic 3.7.1 as 64-bit.

    • clw says:

      I think it was something similar, I don’t have access to it right now.

      Nevertheless, you should be choosing the android folder as the project root in the import projects screen, if I recall correctly.

      • jason says:

        Yup, just got it working. Instead of trying to import an existing project, you have to go to New Project > Android > and then choose existing code (2nd option).

        So now that I have the app in Eclipse, it can’t find my images. I’ll go back and make sure I’m pointed to the right Resources folder. Can android traverse directories to find my images in sub-folders?

        • clw says:

          The images should be visible as soon as you run

          That script (along with building the lib files) should copy the contents of the Resources folder from a level above the android folder to the Resources from within the android folder.

  8. andyque says:

    hi, first thank you for your great tutorials.
    but i have come across a problem.
    i use maxos 10.7 and java version is 1.6,ndk version is 7.
    but when i copy all the android relatived files to ios project.
    when i build the ios project , i get a jni.h can’t be found error.
    i have struggled with this problem for a long time,
    i hope you can help me to figure it out.
    thank you very much!

    • andyque says:

      when i use ,then i get a following error message:

      make: *** No rule to make target `game_shared’, needed by `ndk-app-local’. Stop.

      • clw says:

        That’s very weird as I can’t find any reference to game_shared in Cocos2D-x. Can you perform a string search and see where it’s coming from?

        Jump to your project folder and run

        grep -ir game_shared .

        • sen says:

          hi, I have a same problem.
          grep -ir game_shared says:
          ./android/jni/ := cocos2dx_static cocosdenshion_shared game_shared

          whats wrong with this?

      • Iturri says:

        Here is the flaw: when you modify android/jni/helloworld/ file, this line is not correct:

        LOCAL_MODULE := game

        Replace ‘game’ with ‘game_shared’, and it should work fine now.

        • clw says:

          Thanks! Looks like there were some serious changes in the files in the last Cocos2D-x version. I will update the post accordingly after I get the chance to check things head to toe.

          • Iturri says:

            After that I’ve found another flaw, but this time I couldn’t fix it :( ;).

            Message says ‘cannot find -lcocos2d’. It seems it can’t find cocos2d module, defined at android/jni/helloworld/ and Classes/

          • SteveJ says:

            I have the exact same error that Iturri mentions below:

            “cannot find -lcocos2d
            collect2: ld returned 1 exit status
            make: *** [obj/local/armeabi/] Error 1″

            Any update on this error?

          • tbimpakt says:

            It seems this is the error I am getting, though having LOCAL_MODULE := game_shared will compile the code, it gives me a

            No rule to make target `game_shared’, needed by `ndk-app-local’. Stop.

            Changing it to := game will give me this same issue: cannot find -lcocos2d:

            /devtools/android-ndk-r7c/toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/bin/ld: cannot find -lcocos2d
            collect2: ld returned 1 exit status
            make: *** [obj/local/armeabi/] Error 1

            I guess this is the end of the line? Or has anyone managed to get around this bugger?

  9. Henry says:

    Great tutorial you’ve got here, but I am running into a bit of a problem here with running the makefile that is made. No matter what I do, when I try to call make clean I always get an error that says “makefile:2: *** missing seperator. Stop.” and I am writing it exactly how you have it. Is there anything you suggest that I do, because I’ve looked everywhere and I am stumped :(

    • clw says:

      Make sure you leave an empty line at the end of the file and that the rm commands are indented.

      WordPress might have eaten some of my markup when I wrote the post.

    • Simon Lin says:

      Try to use “tab” key before these two lines.

      rm -rf libs/
      rm -rf obj/

      • Arjun says:

        I have been having the same issue.
        I have tried placing tabs before each rm line and an emply line after them. Still getting the same message. Anything else to do?

  10. Great, thanks for the article!

  11. devboy says:

    Hello, I have the same problem (cannot find -lcocos2d) with cocos2d-1.0.1-x-0.12.0.
    Any way to fix it?

  12. Sisada R. says:

    using cocos2d-1.0.1-x-0.12.0. and got -lcocos2d too.

    btw im really new to cocos2dx (just switch from cocos2d since new project need to export on both ios and android) but it seem to me that isn’t it easier to copy xcode project’s content to android folder created by .sh?

    sorry for my English.

  13. sky says:

    Great tutorial , i have 2 questions.

    After i have done this 4 steps.

    First, copy the android folder from $COCOS2DX_ROOT/SimpleGame/android/ to the iPhone project directory, next to the ios folder (the final path would be SimpleGame/SimpleGame/android/).
    Second, copy the file from $COCOS2DX_ROOT/SimpleGame/Classes/ to SimpleGame/SimpleGame/Classes.
    Third, copy the file from $COCOS2DX_ROOT/cocos2dx/ to SimpleGame/SimpleGame/libs/cocos2dx/.
    Fourth, copy the android folder from $COCOS2DX_ROOT/CocosDenshion to SimpleGame/SimpleGame/libs/CocosDenshion/.
    Finally, copy the platform folder from $COCOS2DX_ROOT/cocos2dx/platform to SimpleGame/SimpleGame/libs/cocos2dx/

    you say edit 3 files and make clean and ./ ,then open eclipse import android project from source.
    4.and Now go to the android folder and type in the terminal
    make clean

    Now i have 2 questions:
    first question:
    4.and Now go to the android folder and type in the terminal
    make clean
    this android folder means $COCOS2DX_ROOT/SimpleGame/android/ or SimpleGame/SimpleGame/android/

    second question:
    the android folder imported to eclipse means $COCOS2DX_ROOT/SimpleGame/android/ or SimpleGame/SimpleGame/android/


    • tbimpakt says:

      Sky – I believe it is meant to be implicit that SimpleGame/SimpleGame/android/ folders anytime the COCOS2DX_ROOT is not used. I did mention that this could be a little more clear in my post below.

  14. tbimpakt says:

    I’m getting a different no rule error than described in the two above. I did run make clean in the android folder.

    make: *** No rule to make target `jni/../../CocosDenshion/android/’. Stop.

    I think making the directory paths a bit more clear, by using PROJECT/Path/To/ would be nice. There are many ‘android’ folders, and other folders of the same names- that said I just went with the assumption the paths implicitly start from PROJECT.

    Any known cause to this no rule?

    • tbimpakt says:

      I managed to figure out that I needed to add /libs/ inside PROJECT/android/jni/

      subdirs := $(addprefix $(LOCAL_PATH)/../../libs/,$(addsuffix /, \
      cocos2dx \
      CocosDenshion/android \

      However now the Android NDK is aborting on me, haven’t yet figured that out – perhaps it does not like that I added ‘libs’ to that path? I’m still trying to investigate this but not exactly on home-turf.

    • tbimpakt says:

      Well, that last issue was my fail, apparently something went wrong while copying over the platforms folder; I got a bit further along but am not sure what this means?

      /devtools/android-ndk-r7c/toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/bin/ld: cannot find -lcocos2d
      collect2: ld returned 1 exit status
      make: *** [obj/local/armeabi/] Error 1

  15. Maximilian Körner says:

    first of all thanks for the tutorial but im having several problems with it.
    I’m working with the latest cocos2dx and xcode versions (on a mac, obviously).

    Everything is clear to me until the files should be copied. These files just don’t exist:


    should they be created, containing your mentioned code?

    Until now i’m running into errors whil executing (my NDK works just fine for android only projects)

    What am i doing wrong?
    Fell free to contact me if you need to know more.


  16. rraallvv says:

    Great work, clw!

    I post this entry mainly because I want to receive updates with new posts and comments.

    By the way, it would be very helpfull too, if you’d post links to the libraries used (AndroidNDK/SDK) also with its respective versions


  17. Jorge says:

    I find some differences with cocos2d-x 2.0.2:

    1) In $COCOS2DX_ROOT/SimpleGame/android/ ==> “android” folder doesn’t exists. New name is “”

    2) $COCOS2DX_ROOT/SimpleGame/Classes/ ==> This file doesn’t exists

    3) android/ ==> some params have changed:
    DIR=”$( cd “$( dirname “${BASH_SOURCE[0]}” )” && pwd )”
    # … use paths relative to current directory

    4) android/jni/ seems different (I don’t know if is only a syntax difference):
    LOCAL_PATH := $(call my-dir)
    include $(CLEAR_VARS)
    LOCAL_MODULE := game_shared
    LOCAL_SRC_FILES := hellocpp/main.cpp \
    ../../Classes/AppDelegate.cpp \
    LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes
    LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static cocosdenshion_static cocos_extension_static
    $(call import-module,CocosDenshion/android) \
    $(call import-module,cocos2dx) \
    $(call import-module,extensions)

    Definitely I have no knowledge to adapt this tutorial .. Any help?

  18. Dunny says:

    Great Article, any chance of an update for the last part, it seems things have been changed in 2.0.2 :(

  19. john says:

    great tutorial, but I got a little problem when I try to $COCOS2DX_ROOT/SimpleGame/android/
    I get to “Using prebuilt externals” but then and error
    ine 90: /opt/Android/android-ndk-r7b/ndk-build: No such file or directory
    I check the folder and ndk-build is there. Could you help me?

    • john says:

      I manage to get the ndk-build working but when I use $COCOS2DX_ROOT/ I only get 3 folders Class,, Resources.
      When I try I get
      Android NDK: Your APP_BUILD_SCRIPT points to an unknown file: ./jni/
      Am I making a wrong step here?

  20. jhankar says:

    I have compiled and everything works fine till compilation. When I try to run it under Eclipse and run it on my android the application crashes on start.

    Following is the stacktrace. Can you help ?

    04-03 21:32:31.420: E/AndroidRuntime(12714): FATAL EXCEPTION: main
    04-03 21:32:31.420: E/AndroidRuntime(12714): java.lang.ExceptionInInitializerError
    04-03 21:32:31.420: E/AndroidRuntime(12714): at java.lang.Class.newInstanceImpl(Native Method)
    04-03 21:32:31.420: E/AndroidRuntime(12714): at java.lang.Class.newInstance(
    04-03 21:32:31.420: E/AndroidRuntime(12714): at
    04-03 21:32:31.420: E/AndroidRuntime(12714): at
    04-03 21:32:31.420: E/AndroidRuntime(12714): at
    04-03 21:32:31.420: E/AndroidRuntime(12714): at$1500(
    04-03 21:32:31.420: E/AndroidRuntime(12714): at$H.handleMessage(
    04-03 21:32:31.420: E/AndroidRuntime(12714): at android.os.Handler.dispatchMessage(
    04-03 21:32:31.420: E/AndroidRuntime(12714): at android.os.Looper.loop(
    04-03 21:32:31.420: E/AndroidRuntime(12714): at
    04-03 21:32:31.420: E/AndroidRuntime(12714): at java.lang.reflect.Method.invokeNative(Native Method)
    04-03 21:32:31.420: E/AndroidRuntime(12714): at java.lang.reflect.Method.invoke(
    04-03 21:32:31.420: E/AndroidRuntime(12714): at$
    04-03 21:32:31.420: E/AndroidRuntime(12714): at
    04-03 21:32:31.420: E/AndroidRuntime(12714): at dalvik.system.NativeStart.main(Native Method)
    04-03 21:32:31.420: E/AndroidRuntime(12714): Caused by: java.lang.UnsatisfiedLinkError: Cannot load library: link_image[1964]: 90 could not load needed library ‘’ for ‘’ (load_library[1106]: Library ‘’ not found)
    04-03 21:32:31.420: E/AndroidRuntime(12714): at java.lang.Runtime.loadLibrary(
    04-03 21:32:31.420: E/AndroidRuntime(12714): at java.lang.System.loadLibrary(
    04-03 21:32:31.420: E/AndroidRuntime(12714): at
    04-03 21:32:31.420: E/AndroidRuntime(12714): … 15 more

    I have 7 files in my libs->armeabi folder … gdb.setup, gdbserver,,,, and

    • jhankar says:

      Yah I figured it out …

      static {


      I was putting box2d in the last line, because of which game_logic was not working … Thanks .. nice tutorial :)

  21. vishal says:

    I got this tye of erroe and not go further..can u solve this i am new in cocos2dx .

    Input package path. For example: org.cocos2dx.example
    Now cocos2d-x supports Android 2.2 or upper version
    ./ line 107: /home/laschweinski/android/android-sdk-linux_86/tools/android: No such file or directory
    input target id:

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" cssfile="">