Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runtime error : ... couldn't find "libjpgt.so" #27

Open
GuillaumeNachury opened this issue Jun 29, 2017 · 1 comment
Open

Runtime error : ... couldn't find "libjpgt.so" #27

GuillaumeNachury opened this issue Jun 29, 2017 · 1 comment

Comments

@GuillaumeNachury
Copy link

Hello,
I'm trying to use the plugin on an Android (6.0.1) but when I call the recognizeText method I got this error :

06-29 22:08:45.412 31275 31408 W System.err: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/io.ionic.starter-1/base.apk"],nativeLibraryDirectories=[/data/app/io.ionic.starter-1/lib/arm, /vendor/lib, /system/lib]]] couldn't find "libjpgt.so"
06-29 22:08:45.419 31275 31408 W System.err: 	at java.lang.Runtime.loadLibrary(Runtime.java:367)
06-29 22:08:45.419 31275 31408 W System.err: 	at java.lang.System.loadLibrary(System.java:1076)
06-29 22:08:45.419 31275 31408 W System.err: 	at com.googlecode.tesseract.android.TessBaseAPI.<clinit>(TessBaseAPI.java:44)
06-29 22:08:45.419 31275 31408 W System.err: 	at com.gmazzoni.cordova.TesseractPlugin.recognizeText(TesseractPlugin.java:80)
06-29 22:08:45.419 31275 31408 W System.err: 	at com.gmazzoni.cordova.TesseractPlugin.execute(TesseractPlugin.java:48)
06-29 22:08:45.419 31275 31408 W System.err: 	at org.apache.cordova.CordovaPlugin.execute(CordovaPlugin.java:98)
06-29 22:08:45.419 31275 31408 W System.err: 	at org.apache.cordova.PluginManager.exec(PluginManager.java:132)
06-29 22:08:45.419 31275 31408 W System.err: 	at org.apache.cordova.CordovaBridge.jsExec(CordovaBridge.java:57)
06-29 22:08:45.419 31275 31408 W System.err: 	at org.apache.cordova.engine.SystemExposedJsApi.exec(SystemExposedJsApi.java:41)
06-29 22:08:45.419 31275 31408 W System.err: 	at org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method)
06-29 22:08:45.419 31275 31408 W System.err: 	at org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:41)
06-29 22:08:45.419 31275 31408 W System.err: 	at android.os.Handler.dispatchMessage(Handler.java:102)
06-29 22:08:45.420 31275 31408 W System.err: 	at android.os.Looper.loop(Looper.java:148)
06-29 22:08:45.420 31275 31408 W System.err: 	at android.os.HandlerThread.run(HandlerThread.java:61)

Any idea how embed this libjpgt lib ?

Thank you

@palucdev
Copy link

Hey! Recently I had the same problem and managed to resolve it by changing dependency name in platforms/android/build.gradle from compile project(':tess-two') to compile 'com.rmtheis:tess-two:7.0.0' (right after // SUB-PROJECT DEPENDENCIES END comment). If in any case you dont want to change dependency, there is another fix: adding

static{
    System.loadLibrary("jpgt");
    System.loadLibrary("pngt");
    System.loadLibrary("lept");
    System.loadLibrary("tess");
  }

to TesseractPlugin.java file.

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

No branches or pull requests

2 participants