Skip to content
This repository has been archived by the owner on Mar 17, 2022. It is now read-only.

base.apk!/lib/arm64-v8a, /vendor/lib64, /system/lib64]]] couldn't find "libjpgt.so" #225

Closed
amarpulli1994 opened this issue Sep 27, 2017 · 9 comments

Comments

@amarpulli1994
Copy link

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:

  1. create a new android app using tess-two.
  2. add following architecture.
    ndk {
    abiFilters "armeabi-v7a", "arm64-v8a"
    }
  3. 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.

@amarpulli1994
Copy link
Author

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.

@amarpulli1994
Copy link
Author

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.

@rmtheis
Copy link
Owner

rmtheis commented Nov 4, 2017

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?

@rmtheis
Copy link
Owner

rmtheis commented Nov 22, 2017

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.

@rmtheis rmtheis closed this as completed Nov 22, 2017
@juechenshiai
Copy link

I have the same problem with 8.0.0

@rmtheis
Copy link
Owner

rmtheis commented Nov 24, 2017

Possibly related to #150.

@sarendshorst
Copy link

@rmtheis With 7.0.0 I get the following libs:
screen shot 2017-11-29 at 13 48 03

With 8.0.0:
screen shot 2017-11-29 at 13 52 15

What should I do to get the missing libs on 8.0.0?

@rmtheis
Copy link
Owner

rmtheis commented Nov 29, 2017

@NFear That's working as intended. Use 7.0.0 or follow the instructions in BUILDING.md to do the build step manually

@JcMinarro
Copy link

I am getting the same problem with version 8.0.0, How could I use version 8.0.0 on 64-bit devices?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants