Setting up Cocos2d-X for Android on Mac


#1

Hello, I’ve been trying to get this going for a couple days now, I’m pretty close but having issues with Cocos2d-x running.

I’m using this as my main guide: http://www.raywenderlich.com/11283/cocos2d-x-for-ios-and-android-getting-started
I’m just trying to get Cocos2d-x running in eclipse/android emulator.

So far everything is smooth up until I run the build_native.sh. Potential issues:

  1. (Is this an issue?) Android NDK: WARNING: APP_PLATFORM android-14 is larger than android:minSdkVersion 8 in ./AndroidManifest.xml
  2. Handful of failures:
    Compile thumb : cocos2dx_static <= quaternion.c
    /Users/user/Desktop/cocos2d-2.0-x-2.0.4/sampleProjet/proj.android/…/…/cocos2dx/kazmath/src/quaternion.c: In function ‘kmQuaternionAssign’:
    /Users/user/Desktop/cocos2d-2.0-x-2.0.4/sampleProjet/proj.android/…/…/cocos2dx/kazmath/src/quaternion.c:478:5: warning: incompatible implicit declaration of built-in function ‘memcpy’ [enabled by default]
    Compile thumb : cocos2dx_static <= ray2.c
    Compile thumb : cocos2dx_static <= utility.c
    Compile thumb : cocos2dx_static <= vec2.c
    Compile thumb : cocos2dx_static <= vec3.c
    Compile thumb : cocos2dx_static <= vec4.c
    /Users/user/Desktop/cocos2d-2.0-x-2.0.4/sampleProjet/proj.android/…/…/cocos2dx/kazmath/src/vec4.c: In function ‘kmVec4Assign’:
    /Users/user/Desktop/cocos2d-2.0-x-2.0.4/sampleProjet/proj.android/…/…/cocos2dx/kazmath/src/vec4.c:150:5: warning: incompatible implicit declaration of built-in function ‘memcpy’ [enabled by default]

and more.
I have no idea if this is preventing my project from running, but I figure I best get those out of the way first as Eclipse won’t let me run the emulator.

Unlike the guide example, even after immediately ‘Creating a project with source’ I have a bunch of errors which prevent me from running the emulator. But I’ll get into that later. Thanks


#2

My environment is:

Mac osx 10.8.2
Eclipse: download the latest one which included the latest Android SDK already
Cocos2d-x: latest version
NDK: the latest version

I followed the same steps and there is no problem at all at this step although I got some other problems in later steps (I solved all of them already).


#3

Thanks for your reply.

After trying some more, I decided to update my OSX from 10.7 to 10.8.2 like you.

So I still see the same compile issues. However if I ignore them for now, I can continue to add the project to Eclipse, fix java src issue, etc. to remove errors.

However when I try to run in Android emulator, the emulator just says “Sorry, ‘sampleproject’ has stopped”

I’m unsure where I’m failing. Thanks

bagus flyer wrote:

My environment is:
>
Mac osx 10.8.2
Eclipse: download the latest one which included the latest Android SDK already
Cocos2d-x: latest version
NDK: the latest version
>
I followed the same steps and there is no problem at all at this step although I got some other problems in later steps (I solved all of them already).