There is a very weird situation. I am using this project in my Android Application. To use it, I have to include JNA
in my project. SO I downloaded jar
file of JNA from here. All is good to go. BUT when I ran the project, it gave me UnsatisfiedLinkError
for libjnidispatch.so
file. I downloaded my desired architecture from this link and re-ran the project. This error is gone and here comes the new one.
Caused by: java.lang.UnsatisfiedLinkError: Unable to load library 'iengine_ansi_iso': Native library (android-arm/libiengine_ansi_iso.so) not found in resource path (.)
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:303)
at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:427)
at com.sun.jna.Library$Handler.<init>(Library.java:179)
at com.sun.jna.Native.loadLibrary(Native.java:569)
at com.sun.jna.Native.loadLibrary(Native.java:544)
at com.foreepay.fingerprintextraction.ansiiso.AnsiIso$AnsiIsoNative.<clinit>(AnsiIso.java:55)
at com.foreepay.fingerprintextraction.ansiiso.AnsiIso.isoCreateTemplate(AnsiIso.java:500)
at com.foreepay.fingerprintextraction.fingerprint.core.ProcessImage.doInBackground(ProcessImage.java:163)
at com.foreepay.fingerprintextraction.fingerprint.core.ProcessImage.doInBackground(ProcessImage.java:39)
at android.os.AsyncTask$2.call(AsyncTask.java:305)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:243)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:761)
I tried to do exactly the same in this case. Downloaded the required file from here, put it in folder (src/main/jniLibs/armeabi-v7a
), but no luck. Since then I tried every possible way to add *.so
file in Android Studio Project, but it failed every time.
These are the links which I have tried to add .so
file but every one has almost the same solution, which is not working in my case OR maybe my case is not their case.
- Adding a .so file in Android Studio
- How to include *.so library in Android Studio?
- Android NDK: how include *.so files in AndroidStudio
And some more.
I am still unable to find the cause. Here is a code block which is causing the issue.
final AnsiIsoNative INSTANCE = (AnsiIsoNative) Native.loadLibrary("iengine_ansi_iso", AnsiIsoNative.class);
Where Native
is a JNA
class.
Any help is appreciated.