FantasyWarrior3D on Android: UnsatisfiedLinkError

Hello!

I successfully compiled and ran FantasyWarrior for Mac.

Next, I want to run it on Android device.

After successful compilation and installation, the game raises the following exception:

E/dalvikvm(22545): dlopen("/data/app-lib/org.cocos2dx.FantasyWarrior3D-1/libcocos2dlua.so") failed: dlopen failed: cannot locate symbol "rand" referenced by "libcocos2dlua.so"...
E/AndroidRuntime(22545): FATAL EXCEPTION: main
E/AndroidRuntime(22545): Process: org.cocos2dx.FantasyWarrior3D, PID: 22545
E/AndroidRuntime(22545): java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "rand" referenced by "libcocos2dlua.so"...
E/AndroidRuntime(22545):     at java.lang.Runtime.loadLibrary(Runtime.java:365)
E/AndroidRuntime(22545):     at java.lang.System.loadLibrary(System.java:526)
E/AndroidRuntime(22545):     at org.cocos2dx.lib.Cocos2dxActivity.onLoadNativeLibraries(Cocos2dxActivity.java:207)
E/AndroidRuntime(22545):     at org.cocos2dx.lib.Cocos2dxActivity.onCreate(Cocos2dxActivity.java:222)
E/AndroidRuntime(22545):     at org.cocos2dx.lua.AppActivity.onCreate(AppActivity.java:60)
E/AndroidRuntime(22545):     at android.app.Activity.performCreate(Activity.java:5451)
E/AndroidRuntime(22545):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1093)
E/AndroidRuntime(22545):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2358)
E/AndroidRuntime(22545):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2452)
E/AndroidRuntime(22545):     at android.app.ActivityThread.access$900(ActivityThread.java:172)
E/AndroidRuntime(22545):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1302)
E/AndroidRuntime(22545):     at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime(22545):     at android.os.Looper.loop(Looper.java:136)
E/AndroidRuntime(22545):     at android.app.ActivityThread.main(ActivityThread.java:5586)
E/AndroidRuntime(22545):     at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(22545):     at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime(22545):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268)
E/AndroidRuntime(22545):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084)
E/AndroidRuntime(22545):     at dalvik.system.NativeStart.main(Native Method)

I’m using the recommended NDK version 10c.

What’s your device?

I have found another the same issue, the author solved it by downloading 32bit NDK.

It is Samsung Galaxy S5.

To be honest, it’s not the first linking exception I encounter. I also noticed it happens just for LUA based cocos2d-x projects.

Can you try the 32bit NDK and let me know the result…

many thanks.

What does that mean? Using 32 bit OS to compile?