Android Error

Hi guys,

I decide to ask your help because i don’t understand this error…

Before two weeks we upload our game and everything works fine…

We are getting an error on one particular device HUAWEI-M920.

Here is the Log File:

java.lang.ExceptionInInitializerError
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1409)
at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1572)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1674)
at android.app.ActivityThread.access$1500(ActivityThread.java:117)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3735)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:662)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.UnsatisfiedLinkError: Couldn’t load game: findLibrary returned null
at java.lang.Runtime.loadLibrary(Runtime.java:429)
at java.lang.System.loadLibrary(System.java:554)
at net.gamethru.games.badmanners.BadManners.(BadManners.java:58)
… 15 more

The load of library is as on cocos2dx examples

static {
System.loadLibrary(“game”);
}

and the libgame.so is located in libs/armeabi

Any Ideas?

Thanks,
Stelios

Hi,

I have the same problem for weeks.
http://www.cocos2d-x.org/boards/6/topics/21309

I think it’s a hard problem, because no one was able to give me some advise. So I develop only for iOS for now, where it works.

This one looks the same, but his problem is with cocosdenshion and not his own library:
http://www.cocos2d-x.org/boards/6/topics/9010

I do have the same problem

I have a similar problem, it seems to only occur with maybe 1 out of 1000 customers of my app, maybe some memory issue with too old hardware? Unfortunately Google does not include info about the used devices.

java.lang.ExceptionInInitializerError
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1409)
at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1565)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
at android.app.ActivityThread.access$1500(ActivityThread.java:117)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3687)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.UnsatisfiedLinkError: Couldn’t load cocos2dcpp: findLibrary returned null
at java.lang.Runtime.loadLibrary(Runtime.java:429)
at java.lang.System.loadLibrary(System.java:554)
at com.victor.AppName.AppName.(AppName.java:50)
… 15 more

I’m using cocos2dx-2.1.4

Edit:
Seems to be a problem only with low-end mobile phones running Android 2.2

Found the answer:
http://stackoverflow.com/questions/3262440/how-to-resolve-the-java-lang-unsatisfiedlinkerror-in-ndk-in-android

Short one (by Daniel Rodriguez):
Also(just ran into this issue), please note that System.loadLibrary() will always throw an exception if you are testing on the Intel Atom x86 emulator. It works just fine on regular Android emulators and debugging on a physical device.

I ran into the same problem

at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.UnsatisfiedLinkError: Couldn’t load cocos2dcpp: findLibrary returned null

The wired thing is it depends on devices.
My Acer device is ok, but hTC Sensation is failed.

I’m sure I installed the same apk file.

Any way to solve this problem?

Thanks a lot!

I have got some reports on this bug too. Samsung Galaxy Note II seems to do it, and also “rk2928sdk” which is some kind of cheap Android tablet. Both have same Cortex A9 CPU. Something to do with that?
I guess I will drop these devices for distribution for now… if there are no other ideas on how to get it working?

LDFLAGS=’-Wl,–fix-cortex-a8’

APP_ABI := armeabi armeabi-v7a x86