Android NDK java.lang.UnsatisfiedLinkError: findLibrary returned null

后端 未结 16 617
我在风中等你
我在风中等你 2020-11-30 01:56

Having the above error in your Android JNI app? Read on...

Up front, I\'ll say that I\'ve already solved this, in my own way, but I feel something in the Android bu

16条回答
  •  情深已故
    2020-11-30 02:25

    I've got this issue too, but for my situation, i'm using my libs in another project. And I don't think it's a matter of eclipse or android-ndk.

    you may check these tips that can lead to UnsatisfiedLinkError and it works fine for me, good luck :)

    1. must following the JNI interface's nameing rule(you said that you did load the library successfully before, so you can ignore this) and the libraries must in directory /your project/libs/armeabi/
    2. if you ensure the above things are done, then you must ensure that your generated libs are installed into your app.apk, otherwise it will still cannot find the lib and thorw you an error. to do this, you right click on your eclipse project name, and go into Build Path - Configure Build Path, on the left menu, choose Java Build Path, then click on the Order and Export tab on the right panel, checking the checkbox before your library name and click OK, then clean,rebuild and run you project, and your libs will be installed into app.apk, things are done.

    enter image description here

    enter image description here

    enter image description here

    EDIT:

    1. in a word, UnsatisfiedLinkError are thrown if the library is not installed into your app.apk, so it cannot be linked sucessfully.

提交回复
热议问题