Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do I get reports of java.lang.UnsatisfiedLinkError from Market

I have a app in the Android market and in its crash reports I get java.lang.UnsatisfiedLinkError crashes and everytime it is for different .so file.

errors looks like

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

or

java.lang.ExceptionInInitializerError
at java.lang.Thread.run(Thread.java:1019)
Caused by: java.lang.UnsatisfiedLinkError: Cannot load library: alloc_mem_region[871]: OOPS: 116 cannot map library ********. no vspace available.

or

java.lang.UnsatisfiedLinkError: Couldn't load ******: findLibrary returned null
at java.lang.Runtime.loadLibrary(Runtime.java:429)
at java.lang.System.loadLibrary(System.java:554)

It looks like some devices can not find some .so files.. The crash is not for any particular .so file. I have around 4 .so files in my app and sometimes it crashes for 1 and sometimes it crashes for another.

I could never reproduce this issue while testing, though I tested on almost all versions of Android...

Any pointers would be highly appreciated

Thanks

like image 756
Naveen Avatar asked Dec 15 '11 07:12

Naveen


People also ask

Why java lang UnsatisfiedLinkError?

lang. UnsatisfiedLinkError runtime error. More specifically, this error is thrown whenever the JVM is unable to find an appropriate native-language definition of a method declared native , while attempting to resolve the native libraries at runtime [2]. The UnsatisfiedLinkError error is a subclass of the java.

What is UnsatisfiedLinkError?

public class UnsatisfiedLinkError extends LinkageError. Thrown if the Java Virtual Machine cannot find an appropriate native-language definition of a method declared native . Since: JDK1.0 See Also: Runtime , Serialized Form.

What does system loadLibrary do?

The System. loadLibrary() takes as parameter a library name, locates a native library that corresponds to that name, and loads the native library. For information about how a native library is located by the System.


1 Answers

I've seen similar issues myself – this seems to be affecting a very small number of users, and I can't directly correlate it to device types or operating systems. From the research I've done, however, I've found a discussion on the Cyanogenmod Google Code page; to quickly summarize: it sounds like some builds of that mod have not precisely copied some changes Google made to system-level libraries, meaning that some symbols (__android_log_print, for example) could be causing errors including causing your library to fail to load.

I'm in the process of trying to pin this down further, but I thought I'd share what I have to date.

like image 199
Sydin Avatar answered Sep 21 '22 12:09

Sydin