Cocos2d-x with Genymotion?

If i try to run my application thru Genymotion emulator (super fast android emulator), the application stops working and i get these errors http://puu.sh/4U59U.png

Is there any way to run it?

Hi Tomáš

I was trying as well to run Genymotion emulator to avoid that annoying slowness of the official emulator and I was given the same errors you have but at the end I think I have solved it with two changes:

  1. You need to be able to generate libcocos2dcpp.so for different architecture, In my case I was generating only the armabi, and you need armabi-v7a and x86,Though I am not sure of the need of the v7a architecture, I think Genymotion is emulating android running a linux virtual machine with x86 architecture. For generating this new architectures you need to change proj.android/jni/Application.mk this is the change done to that file:
    <pre>
    APP_STL := gnustl_static
    +APP_ABI := armeabi armeabi-v7a x86
    APP_CPPFLAGS := frttiDCC_ENABLE_CHIPMUNK_INTEGRATION=1 -DCOCOS2D_DEBUG=1
    </pre>
    with that change you should generate three different versions of the .so library
  2. Once you have that libraries changes you will notice that even the emulator is unable to run your game as and it will complain about OpenGL configurations, thats because that run is not flagged as to run in a emulator and the game configures OpenGL differently. For getting that run flagged as emulator run you need to introduce a little change on /cocos2dx/platform/android/java/src/org/cocos2dx/lib/Cocos2dxActivity.java
    You need to change the function isAndroidEmulator to include this check product.contains("vbox") that vbox is a substring presented on the Genymotion emulator product name. In a nutshell, replace:
    <pre>
    isEmulator = product.equals(“sdk”) || product.contains(“_sdk”) || product.contains(“sdk_”);@
    </pre>
    with
    <pre>
    isEmulator = product.equals(“sdk”) || product.contains(“_sdk”) || product.contains(“sdk_”) || product.contains(“vbox”);@
    </pre>

I think with that two changes you will be ready to run cocos2dx applications on Genymotion

Cheers

3 Likes

Borja Outerelo Gamarra, Thank you very much

@Borja Outerelo Gamarra: Thank you so much !