Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Couldn't load lept from loader findLibrary returned null?

Tags:

android

ocr

HI am working on OCR(Optical Character Recognization) i got a sample project from github.For this project am using tess-test library project and the project builds and executes successfully but whenever the TessBaseAPI is called the app stopped unfortunately..and it shows the following log error

12-20 18:27:18.791: E/AndroidRuntime(24466): java.lang.ExceptionInInitializerError
12-20 18:27:18.791: E/AndroidRuntime(24466):    at com.datumdroid.android.ocr.simple.SimpleAndroidOCRActivity.onPhotoTaken(SimpleAndroidOCRActivity.java:211)
12-20 18:27:18.791: E/AndroidRuntime(24466):    at com.datumdroid.android.ocr.simple.SimpleAndroidOCRActivity.onActivityResult(SimpleAndroidOCRActivity.java:135)
12-20 18:27:18.791: E/AndroidRuntime(24466):    at android.app.Activity.dispatchActivityResult(Activity.java:5293)
12-20 18:27:18.791: E/AndroidRuntime(24466):    at android.app.ActivityThread.deliverResults(ActivityThread.java:3315)
12-20 18:27:18.791: E/AndroidRuntime(24466):    at android.app.ActivityThread.handleSendResult(ActivityThread.java:3362)
12-20 18:27:18.791: E/AndroidRuntime(24466):    at android.app.ActivityThread.access$1100(ActivityThread.java:141)
12-20 18:27:18.791: E/AndroidRuntime(24466):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1282)
12-20 18:27:18.791: E/AndroidRuntime(24466):    at android.os.Handler.dispatchMessage(Handler.java:99)
12-20 18:27:18.791: E/AndroidRuntime(24466):    at android.os.Looper.loop(Looper.java:137)
12-20 18:27:18.791: E/AndroidRuntime(24466):    at android.app.ActivityThread.main(ActivityThread.java:5039)
12-20 18:27:18.791: E/AndroidRuntime(24466):    at java.lang.reflect.Method.invokeNative(Native Method)
12-20 18:27:18.791: E/AndroidRuntime(24466):    at java.lang.reflect.Method.invoke(Method.java:511)
12-20 18:27:18.791: E/AndroidRuntime(24466):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
12-20 18:27:18.791: E/AndroidRuntime(24466):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
12-20 18:27:18.791: E/AndroidRuntime(24466):    at dalvik.system.NativeStart.main(Native Method)
12-20 18:27:18.791: E/AndroidRuntime(24466): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load lept from loader dalvik.system.PathClassLoader[dexPath=/data/app/com.datumdroid.android.ocr.simple-1.apk,libraryPath=/data/app-lib/com.datumdroid.android.ocr.simple-1]: findLibrary returned null
12-20 18:27:18.791: E/AndroidRuntime(24466):    at java.lang.Runtime.loadLibrary(Runtime.java:365)
12-20 18:27:18.791: E/AndroidRuntime(24466):    at java.lang.System.loadLibrary(System.java:535)
12-20 18:27:18.791: E/AndroidRuntime(24466):    at com.googlecode.tesseract.android.TessBaseAPI.<clinit>(TessBaseAPI.java:47)

please give solution to my problem am stucked from 5 days it is required in my application.

i googled a lot didn't find any solution.. Thank You

like image 762
Santosh Avatar asked Dec 20 '12 13:12

Santosh


1 Answers

Make sure that the library file "liblept.so" exist either in libs/armeabi or libs/armeabi-v7a, if they exists there, use 7Zip/WinRAR to open the generated APK file and make sure it exists in the APK as well.

like image 63
Kai Avatar answered Sep 21 '22 20:09

Kai