How to load static native libraries in android application?

357 views
Skip to first unread message

Pink

unread,
Dec 14, 2010, 10:20:13 PM12/14/10
to android-ndk
Hi,

I have one static native library. I am using it in my android
application.

I am compiling my appliacation using Android.mk file.

The make file using "LOCAL_STATIC_LIBRARIES" to include the static
library.

The library is placed in "libs" folder.

I am loading the library by using "System.load()".

But i am getting "UnsatisfiedLinkError".

What is wrong here?


Thanks in advance.....

Tim Mensch

unread,
Dec 15, 2010, 10:40:43 AM12/15/10
to andro...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 12/14/2010 8:20 PM, Pink wrote:

> But i am getting "UnsatisfiedLinkError".


That means that Java can't find the symbol it's looking for. You
probably got the name wrong.

Search the list for instructions on how to use javah.

Tim
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJNCOF7AAoJENSbqLBCyKKshL4H/3TV6bhmdm1KSXwAMCVGtqRW
iaQ7RdOgjdrHtWws5hN8ckvtVc64ut35naGMqZv2RaMu0rW72jdp1kTEq+amk1/N
qf7eEDdn9obkDAo0LqiVsYE2lOu2r5erYx868LJjXekm3xtwfrepxahlVnB+WHax
5/tIGTzSLRGMwmrk3wF60W6elvBQVBSk7TXguAq3xeHSDrPm1e2qlAfax2OpScO9
t/5se865gOpdSn7yVSyftQwyngR5Ovs8qFO+C+dqKCrrAwpt9ToVUVEtaGEJZYSv
stCyl97ts7FNGGks1mLzc3LWthA/0dU0wDN4IiXkl+2R7a5eftXJ/zEGVvhwMzk=
=pBKj
-----END PGP SIGNATURE-----

Igor R

unread,
Dec 15, 2010, 10:48:33 AM12/15/10
to andro...@googlegroups.com
>   I have one static native  library. I am using it in my android
> application.
>
>   I am compiling my appliacation using Android.mk file.
>
>   The make file using "LOCAL_STATIC_LIBRARIES" to include the static
> library.
>
>   The library is placed in "libs" folder.
>
>   I am loading the library by using "System.load()".
>
>   But i am getting "UnsatisfiedLinkError".

Do you load static or *shared* library? Static libs can be linked to
your shared lib, but you can load only shared libs.

Reply all
Reply to author
Forward
0 new messages