-
Notifications
You must be signed in to change notification settings - Fork 1.4k
UnsatisfiedLinkError; thrown while initializing Lcom/googlecode/tesseract/android/TessBaseAPI 'libjpgt.so' and 'liblept.so' w/ compile 'com.rmtheis:tess-two:6.0.0' #150
Comments
Did you try doing a clean or File->Invalidate Caches and Restart? |
What happens when you go to run the test cases? Please reopen this issue with more complete instructions on how to reproduce the problem. |
Steps to reproduce the error: Run a functioning app using app/build.grade with:
Everything works fine Update app/build.gradle to: On the line of your code that calls "new TessBaseAPI()" error will be thrown. Change app/build.gradle back to To try and resolve, I 1) invalidated caches and restarted, 2) ran clean build, 3) compiled and installed app on device. Code to reproduce: public static TessBaseAPI gTess = null; Also, I tried finding the test cases, but since I am calling it from the build.gradle instead of downloading the source and importing as a module, I do not have the test cases available that I can find. Thanks! |
Is your |
here's that piece of my app/build.gradle:
dependencies { 5.4.1 works great, as soon as I change that to 6.0.1 I get the link error. |
After you change to 6.0.1, and you choose "Sync Now", do you get |
I do. Everything appears fine in Android Studio. It's not until I actually run the app that it crashes. |
If you unzip your APK and look in its |
Yup, they're all there. Really strange :/ |
Hmm... does it still happen if you remove OpenCV, or otherwise try a simplified version of your app? |
Yup. The only change is that compile line in the build.gradle |
What I mean is that you should try removing unrelated parts of your app to narrow down what's causing the problem. I suspect the problem is somehow related to your setup or your code. For example, I can make this same change on my android-ocr project without hitting this error. Are you able to create a simplified/minimal example that you can share on Github that demonstrates the problem? |
Also see #127. |
with compile 'com.rmtheis:tess-two:6.0.1', I have same problem at Galaxy Nexus(4.2.2),but no problem at other device. |
@seantibb @guoyong0423 which version of Android are you running on when you see this error? |
@rmtheis API 15 here...Ice Cream Sandwich |
the error reappeared at another device(4.1.2) |
same here.
6.0.2 works fine on
6.0.2 stopped working on
|
It looks to me like this is a bug that occurs on devices running Android versions prior to 4.4 (KitKat). I don't think it's directly fixable from this project, but there are some options for a workaround:
|
Also worth trying would be explicitly loading libjpeg, with the libraries in this order:
|
Thank you very match! |
can u please help me?? |
Its working fine for initial few api calls but getHOCRText() method responding very slow after continuous usage. The image I am passing for scanning is binarized image. |
Hey team awesome! I found an issue tonight that I can't seem to find a workaround for. I updated my application to call tess-two 6.0.0 from tess-two 5.4.1 and started getting the error below about being unable to load libjpgt.so and liblept.so. I reverted back to 5.4.1 and do not get the same error.
This is an app targeting Ice Cream Sandwich (min SDK 15) for an older device.
Any suggestions?
Stacktrace:
06-05 23:03:15.565 29589-29589/[redacted] D/dalvikvm: Trying to load lib /data/data/[redacted for security]/lib/liblept.so 0x4103ca50 06-05 23:03:15.565 29589-29589/[redacted] W/dalvikvm: Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lcom/googlecode/tesseract/android/TessBaseAPI; 06-05 23:03:15.565 29589-29589/[redacted] D/AndroidRuntime: Shutting down VM 06-05 23:03:15.565 29589-29589/[redacted] W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x40abb1f8) 06-05 23:03:15.573 29589-29589/[redacted] E/AndroidRuntime: FATAL EXCEPTION: main java.lang.ExceptionInInitializerError at [redacted].MainActivity.doOCR(MainActivity.java:561) at [redacted].MainActivity.onPictureTaken(MainActivity.java:417) at android.hardware.Camera$EventHandler.handleMessage(Camera.java:689) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:4424) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.UnsatisfiedLinkError: Cannot load library: link_image[1936]: 104 could not load needed library 'libjpgt.so' for 'liblept.so' (load_library[1091]: Library 'libjpgt.so' not found) at java.lang.Runtime.loadLibrary(Runtime.java:370) at java.lang.System.loadLibrary(System.java:538) at com.googlecode.tesseract.android.TessBaseAPI.<clinit>(TessBaseAPI.java:44) at [redacted].MainActivity.doOCR(MainActivity.java:561) at [redacted].MainActivity.onPictureTaken(MainActivity.java:417) at android.hardware.Camera$EventHandler.handleMessage(Camera.java:689) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:4424) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) at dalvik.system.NativeStart.main(Native Method)
The text was updated successfully, but these errors were encountered: