Crash on Genymotion emulator

Cocos2d-x app getting crash on Genymotion virtual device.

The situation

  1. Create Cocos2d-x project as below.
    cocos new TestingProject -p com.TestingProject -l cpp
  2. Change the parameter of proj.android/jni/Application.mk
    APP_ABI := x86
  3. Execute the project.
    cocos run -p android
  4. Crash!
    Fatal signal 11 (SIGSEGV) at 0x00000000 (code=128)

Environment

Cocos2d-x 3.10
Android SDK API level 15
Android NDK r9d
Apache ANT 1.9.7

The reason

It is just bad pair to Android SDK API level 15 and x86 device.

The solution

  1. Add command option except SDK 15 if the project is compiled.
    cocos run -p android -ap android-20
  2. Add parameter into (ProjectName)/proj.android/jni/Application.mk
    APP_CPPFLAGS += -U__SSE__

Ref link

https://github.com/sqlcipher/android-database-sqlcipher/issues/200
https://github.com/cocos2d/cocos2d-x/issues/8964