My app works fine on emulator but not on real device, got UnsatisfiedLinkError

1,183 views
Skip to first unread message

Chen

unread,
May 9, 2011, 9:00:04 AM5/9/11
to android-ndk
Hi all,
I've developped an application using NDK r5b, it works perfect on the
emulator, but crashs on a real device. I checked the log via ddms, the
reason of crashing was UnsatisfiedLinkError.
Here is the log message:

05-09 20:12:08.791: ERROR/xface(2242):
com.hello.xface.MainService.<clinit>(): Library xfacecore not found
05-09 20:12:08.791: WARN/dalvikvm(2242): No implementation found for
native Lcom/hello/xface/jnihelper/xFaceEngine;.create ()Z
05-09 20:12:08.801: WARN/dalvikvm(2242): threadid=3: thread exiting
with uncaught exception (group=0x40026268)
05-09 20:12:08.801: ERROR/AndroidRuntime(2242): Uncaught handler:
thread main exiting due to uncaught exception
05-09 20:12:08.811: ERROR/AndroidRuntime(2242):
java.lang.UnsatisfiedLinkError: create
...

The 'xfacecore' is the shared library of my app, I checked it on the
device it does on the right place which is /data/data/com.hello.xface/
lib/libxfacecore.so

The eaxct same apk works fine on emulator(android 1.6) but got above
errors on a real device(android2.1).

Does anyone know the reason?

fadden

unread,
May 9, 2011, 1:57:06 PM5/9/11
to android-ndk
On May 9, 6:00 am, Chen <golde...@gmail.com> wrote:
> 05-09 20:12:08.791: ERROR/xface(2242):
> com.hello.xface.MainService.<clinit>(): Library xfacecore not found
[...]
> The eaxct same apk works fine on emulator(android 1.6) but got above
> errors on a real device(android2.1).
>
> Does anyone know the reason?

General tips:
http://android.git.kernel.org/?p=platform/dalvik.git;a=blob_plain;f=docs/jni-tips.html;hb=HEAD#FAQUnsatisfied

Look a few lines above this in the log. Do you see a failure message
from dalvikvm / dlopen()?

Chen

unread,
May 9, 2011, 10:01:08 PM5/9/11
to android-ndk
No, I can't see anything about dlopen()
I have two devices and it's very strange that both devices have little
error messages than the emulator.
for example, the emulator will print dlopen() related error message if
there's link problem , howevery the device never print

On May 10, 1:57 am, fadden <fad...@android.com> wrote:
> On May 9, 6:00 am, Chen <golde...@gmail.com> wrote:
>
> > 05-09 20:12:08.791: ERROR/xface(2242):
> > com.hello.xface.MainService.<clinit>(): Library xfacecore not found
> [...]
> > The eaxct same apk works fine on emulator(android 1.6) but got above
> > errors on a real device(android2.1).
>
> > Does anyone know the reason?
>
> General tips:
>  http://android.git.kernel.org/?p=platform/dalvik.git;a=blob_plain;f=d...

Riasat Abir

unread,
May 10, 2011, 12:05:26 AM5/10/11
to andro...@googlegroups.com
Does you your program work well on emulator (2.1)?


--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.




--

HimHim

Chen

unread,
May 23, 2011, 5:26:44 AM5/23/11
to android-ndk
Thanks Riasat
I finally find the reason.
I compiled it using NDK target android 4, and it also worked fine on
android 4
Unfortunately, in android 7(also called 2.1) it can not work.
> HimHim
Reply all
Reply to author
Forward
0 new messages