base.apk!/lib/arm64-v8a, /vendor/lib64, /system/lib64]]] couldn't find "libjpgt.so"
amarpulli1994 opened this issue ยท 9 comments
Summary:
I am using 'com.rmtheis:tess-two:8.0.0' and compiled for below architectures
ndk {
abiFilters "armeabi-v7a", "arm64-v8a"
}
it works for "armeabi-v7a" only.
Steps to reproduce the issue:
- create a new android app using tess-two.
- add following architecture.
ndk {
abiFilters "armeabi-v7a", "arm64-v8a"
} - Then from android app call
TessBaseAPI baseApi = new TessBaseAPI();
Expected result:
it should execute the TessBaseAPI without any issues.
Actual result:
FATAL EXCEPTION: main
Process: com.scanner.cheque, PID: 17592
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.scanner.cheque-1/base.apk"],nativeLibraryDirectories=[/data/app/com.scanner.cheque-1/lib/arm64, /data/app/com.scanner.cheque-1/base.apk!/lib/arm64-v8a, /vendor/lib64, /system/lib64]]] couldn't find "libjpgt.so"
at java.lang.Runtime.loadLibrary(Runtime.java:367)
at java.lang.System.loadLibrary(System.java:1076)
at com.googlecode.tesseract.android.TessBaseAPI.<clinit>(TessBaseAPI.java:44)
at com.scanner.cheque.MainActivity$1.onClick(MainActivity.java:220)
at android.view.View.performClick(View.java:5272)
at android.view.View$PerformClick.run(View.java:21528)
at android.os.Handler.handleCallback(Handler.java:815)
at android.os.Handler.dispatchMessage(Handler.java:104)
at android.os.Looper.loop(Looper.java:207)
at android.app.ActivityThread.main(ActivityThread.java:5790)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1015)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:876)
Tess-two version:
com.rmtheis:tess-two:8.0.0
Android version:
android 7.1.1
Phone/device model:
one plus 3t, vivo 5.
Phone/device architecture (armeabi, armeabi-v7a, x86, mips, arm64-v8a, x86_64, mips64):
arm64-v8a
Link to training data used:
not required.
Link to image used as input:
not required.
Hi,
Do we need to make changes as mentioned in commit #124 to libjpeg ?
libpng has added support for "arm64-v8a" and not libjpeg, because we searched "ARM_NEON" in repository and only found in (https://github.com/rmtheis/tess-two/search?utf8=%E2%9C%93&q=__ARM_NEON__&type=) in below files.
tess-two/jni/libpng/pngpriv.h
tess-two/jni/libpng/configure.ac
tess-two/jni/libpng/scripts/pnglibconf.dfa
tess-two/jni/libpng/CHANGES
Thanks.
Hi,
Sorry for closing without providing details.
We resolved the issue by using below version of tess-two.
compile 'com.rmtheis:tess-two:7.0.0'
We also added below code before calling the api as below.
System.loadLibrary("jpgt");
TessBaseAPI baseApi = new TessBaseAPI();
baseApi.setDebug(true);
baseApi.init(DATA_PATH, lang1);
We will not close this issue since it is still persists in 8.0.0
Thanks.
Thanks for contributing this.
I wasn't able to reproduce this issue when running the unit tests on 64-bit emulator. Do the unit tests pass for you?
I tried reproducing this on a 64-bit device and a 64-bit emulator. I wasn't able to reproduce the issue. Please reopen if you're able to provide more info.
I have the same problem with 8.0.0
@rmtheis With 7.0.0 I get the following libs:
What should I do to get the missing libs on 8.0.0?
@NFear That's working as intended. Use 7.0.0 or follow the instructions in BUILDING.md
to do the build step manually
I am getting the same problem with version 8.0.0, How could I use version 8.0.0 on 64-bit devices?