0

I have built cocos2d-x game using Android API 21 but it is not working on lower API version, game crashes on startup. These are the logs:

07-28 22:09:47.358: E/dalvikvm(6483): dlopen("/data/app-lib/com.pld.readingrace1a-1/libcocos2dcpp.so") failed: Cannot load library: soinfo_relocate(linker.cpp:975): cannot locate symbol "rand" referenced by "libcocos2dcpp.so"...

07-28 22:09:47.366: E/AndroidRuntime(6483): FATAL EXCEPTION: main
07-28 22:09:47.366: E/AndroidRuntime(6483): java.lang.ExceptionInInitializerError
07-28 22:09:47.366: E/AndroidRuntime(6483):     at java.lang.Class.newInstanceImpl(Native Method)
07-28 22:09:47.366: E/AndroidRuntime(6483):     at java.lang.Class.newInstance(Class.java:1319)
07-28 22:09:47.366: E/AndroidRuntime(6483):     at android.app.Instrumentation.newActivity(Instrumentation.java:1054)
07-28 22:09:47.366: E/AndroidRuntime(6483):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2097)
07-28 22:09:47.366: E/AndroidRuntime(6483):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
07-28 22:09:47.366: E/AndroidRuntime(6483):     at android.app.ActivityThread.access$600(ActivityThread.java:141)
07-28 22:09:47.366: E/AndroidRuntime(6483):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
07-28 22:09:47.366: E/AndroidRuntime(6483):     at android.os.Handler.dispatchMessage(Handler.java:99)
07-28 22:09:47.366: E/AndroidRuntime(6483):     at android.os.Looper.loop(Looper.java:137)
07-28 22:09:47.366: E/AndroidRuntime(6483):     at android.app.ActivityThread.main(ActivityThread.java:5041)
07-28 22:09:47.366: E/AndroidRuntime(6483):     at java.lang.reflect.Method.invokeNative(Native Method)
07-28 22:09:47.366: E/AndroidRuntime(6483):     at java.lang.reflect.Method.invoke(Method.java:511)
07-28 22:09:47.366: E/AndroidRuntime(6483):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
07-28 22:09:47.366: E/AndroidRuntime(6483):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
07-28 22:09:47.366: E/AndroidRuntime(6483):     at java.lang.Runtime.loadLibrary(Runtime.java:371)
07-28 22:09:47.366: E/AndroidRuntime(6483):     at java.lang.System.loadLibrary(System.java:535)
07-28 22:09:47.366: E/AndroidRuntime(6483):     at org.cocos2dx.cpp.AppActivity.<clinit>(AppActivity.java:272)

I have searched and found some answers on stack overflow like this one

but I want to build my game on API 21 because I am using some new features and I want it to work on older API versions. Can someone help in this regard. Thanks.

Community
  • 1
  • 1

1 Answers1

0

Make sure you set your TARGET SDK to a lower version. You should still be able to access most of the API 21 features.

Leandro Glossman
  • 363
  • 4
  • 10