0

My Android game is built with cocos2dx 3.0, and it works well on my Nexus 5. However, my friends who have Galaxy S4 says the game crashes when opening.

Edit: tested with more devices. Works on Nexus 5 Lollipop and Nexus 7 Lollipop. Doesn't work on Galaxy S4 KitKat, Galaxy Note 3 KitKat and Nexus 5 KitKat. Seems like it works on API 21 but not on 19. However, I set both minSDKversion and target version to 19 which is KitKat)

So I downloaded Genymotion emulator to simulate on Galaxy S4 since Android SDK emulator didn't seem to have Galaxy S4 on the list. Then I found Genymotion doesn't work with APKs build for ARM. Therefore, I added the line APP_ABI := armeabi armeabi-v7a x86 on application.mk so that the APK supports all three architecture.

Also, I modified the cocos2dx code to treat Genymotion as emulator.

if (product != null) {
    isEmulator = product.equals("sdk") || product.contains("_sdk") || product.contains("sdk_") || product.contains("vbox");
} // vbox part is the added part

Now, when I install and run the APK on the S4 emulator, it crashes with error saying

12-22 22:22:34.502: D/Cocos2dxActivity(1280): model=Samsung Galaxy S4 - 4.4.4 - API 19 - 1080x1920
12-22 22:22:34.506: D/Cocos2dxActivity(1280): product=vbox86p
12-22 22:22:34.506: D/Cocos2dxActivity(1280): isEmulator=true
12-22 22:22:34.510: D/dalvikvm(1280): Trying to load lib /data/app-lib/com.DoomChitGames.LittleSnake-2/libcocos2dcpp.so 0xa508c970
12-22 22:22:34.514: E/dalvikvm(1280): dlopen("/data/app-lib/com.DoomChitGames.LittleSnake-2/libcocos2dcpp.so") failed: dlopen failed: library "/system/lib/libhoudini.so" not found
12-22 22:22:34.514: D/AndroidRuntime(1280): Shutting down VM
12-22 22:22:34.514: W/dalvikvm(1280): threadid=1: thread exiting with uncaught exception (group=0xa4d00b20)
12-22 22:22:34.514: E/AndroidRuntime(1280): FATAL EXCEPTION: main
12-22 22:22:34.514: E/AndroidRuntime(1280): Process: com.DoomChitGames.LittleSnake, PID: 1280
12-22 22:22:34.514: E/AndroidRuntime(1280): java.lang.UnsatisfiedLinkError: dlopen failed: library "/system/lib/libhoudini.so" not found
12-22 22:22:34.514: E/AndroidRuntime(1280):     at java.lang.Runtime.loadLibrary(Runtime.java:364)
12-22 22:22:34.514: E/AndroidRuntime(1280):     at java.lang.System.loadLibrary(System.java:526)
12-22 22:22:34.514: E/AndroidRuntime(1280):     at org.cocos2dx.lib.Cocos2dxHelper.init(Cocos2dxHelper.java:94)
12-22 22:22:34.514: E/AndroidRuntime(1280):     at org.cocos2dx.lib.Cocos2dxActivity.onCreate(Cocos2dxActivity.java:84)
12-22 22:22:34.514: E/AndroidRuntime(1280):     at android.app.Activity.performCreate(Activity.java:5231)
12-22 22:22:34.514: E/AndroidRuntime(1280):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
12-22 22:22:34.514: E/AndroidRuntime(1280):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148)
12-22 22:22:34.514: E/AndroidRuntime(1280):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)
12-22 22:22:34.514: E/AndroidRuntime(1280):     at android.app.ActivityThread.access$800(ActivityThread.java:135)
12-22 22:22:34.514: E/AndroidRuntime(1280):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
12-22 22:22:34.514: E/AndroidRuntime(1280):     at android.os.Handler.dispatchMessage(Handler.java:102)
12-22 22:22:34.514: E/AndroidRuntime(1280):     at android.os.Looper.loop(Looper.java:136)
12-22 22:22:34.514: E/AndroidRuntime(1280):     at android.app.ActivityThread.main(ActivityThread.java:5001)
12-22 22:22:34.514: E/AndroidRuntime(1280):     at java.lang.reflect.Method.invokeNative(Native Method)
12-22 22:22:34.514: E/AndroidRuntime(1280):     at java.lang.reflect.Method.invoke(Method.java:515)
12-22 22:22:34.514: E/AndroidRuntime(1280):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
12-22 22:22:34.514: E/AndroidRuntime(1280):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
12-22 22:22:34.514: E/AndroidRuntime(1280):     at dalvik.system.NativeStart.main(Native Method)
12-22 22:22:38.490: I/Process(1280): Sending signal. PID: 1280 SIG: 9

Does anyone know what the problem is?

closed as off-topic by Ryan Conrad, RossC, bmdixon, Sid, Izzy Dec 26 '14 at 14:34

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions about writing and publishing Android apps, writing custom ROMs, and other topics that are primarily of concern to developers are off-topic. Consider taking advantage of other resources that may be appropriate for your question." – RossC, bmdixon, Izzy
If this question can be reworded to fit the rules in the help center, please edit the question.

2

Houdini is a library provided by Intel to convert ARM NEON intrinsics to the corresponding SSE instructions at run-time. It appears that cocos (or your game) is still using NEON even though you're compiling for x86 now.

It may be as simple as doing a full rebuild to make sure all object files are recompiled respecting your change to the ABI:

ndk-build -B <your_normal_parameters>

Also make sure that any other Application.mk files are updated with the new ABIs as well.

If that quick fix doesn't work, I'd try creating a normal x86 emulator using the Android SDK and HAXM. If you're still running into problems, then your issue may be a little harder to diagnose given the information you've provided.

However, I think you may be making more work for yourself than is necessary.

Ask your friends with an S4 to enable "Power menu bug reports" under Settings / System / Developer Options. Have them run your app, and after it crashes, ask them to hold the power button and select "Bug report". When it's finished they can email it to you, and you'll have the full stack and lots of other information that will help you determine the actual problem on their S4.

Another option is to extend the Application class in your app, and set an uncaught exception handler. When your app crashes due to an uncaught exception, you can then do something with the exception - save the stack to a text file on the SD card, email it, etc. But if your crash is in native code, you may not get much useful info out of the exception.

HTH.

Not the answer you're looking for? Browse other questions tagged or ask your own question.