Simple-Android-OCR Project Error, Suddenly shows that "Unfortunately Simple-Android-OCR has stopped

StackOverflow https://stackoverflow.com/questions/23381385

  •  12-07-2023
  •  | 
  •  

سؤال

I imported libraries like test-two and also assigned path to ndk build successfully… I solved all the errors.. But a problem, When I am trying to run, it shows an error message after captured image i.e, “Unfortunately Simple-Android-OCR has been stopped” .. I can’t find whats the mistake. Here is the logcat

04-30 11:52:08.607: V/SimpleAndroidOCR.java(28834): Before baseApi
04-30 11:52:08.608: W/dalvikvm(28834): Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lcom/googlecode/tesseract/android/TessBaseAPI;
04-30 11:52:08.610: D/AndroidRuntime(28834): Shutting down VM
04-30 11:52:08.610: W/dalvikvm(28834): threadid=1: thread exiting with uncaught exception (group=0x410c4908)
04-30 11:52:08.623: E/AndroidRuntime(28834): FATAL EXCEPTION: main
04-30 11:52:08.623: E/AndroidRuntime(28834): java.lang.ExceptionInInitializerError
04-30 11:52:08.623: E/AndroidRuntime(28834):    at com.datumdroid.android.ocr.simple.SimpleAndroidOCRActivity.onPhotoTaken(SimpleAndroidOCRActivity.java:196)
04-30 11:52:08.623: E/AndroidRuntime(28834):    at com.datumdroid.android.ocr.simple.SimpleAndroidOCRActivity.onActivityResult(SimpleAndroidOCRActivity.java:133)
04-30 11:52:08.623: E/AndroidRuntime(28834):    at android.app.Activity.dispatchActivityResult(Activity.java:5204)
04-30 11:52:08.623: E/AndroidRuntime(28834):    at android.app.ActivityThread.deliverResults(ActivityThread.java:3298)
04-30 11:52:08.623: E/AndroidRuntime(28834):    at android.app.ActivityThread.handleSendResult(ActivityThread.java:3345)
04-30 11:52:08.623: E/AndroidRuntime(28834):    at android.app.ActivityThread.access$1100(ActivityThread.java:149)
04-30 11:52:08.623: E/AndroidRuntime(28834):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1348)
04-30 11:52:08.623: E/AndroidRuntime(28834):    at android.os.Handler.dispatchMessage(Handler.java:99)
04-30 11:52:08.623: E/AndroidRuntime(28834):    at android.os.Looper.loop(Looper.java:153)
04-30 11:52:08.623: E/AndroidRuntime(28834):    at android.app.ActivityThread.main(ActivityThread.java:4987)
04-30 11:52:08.623: E/AndroidRuntime(28834):    at java.lang.reflect.Method.invokeNative(Native Method)
04-30 11:52:08.623: E/AndroidRuntime(28834):    at java.lang.reflect.Method.invoke(Method.java:511)
04-30 11:52:08.623: E/AndroidRuntime(28834):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:821)
04-30 11:52:08.623: E/AndroidRuntime(28834):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:584)
04-30 11:52:08.623: E/AndroidRuntime(28834):    at dalvik.system.NativeStart.main(Native Method)
04-30 11:52:08.623: E/AndroidRuntime(28834): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load lept: findLibrary returned null
04-30 11:52:08.623: E/AndroidRuntime(28834):    at java.lang.Runtime.loadLibrary(Runtime.java:365)
04-30 11:52:08.623: E/AndroidRuntime(28834):    at java.lang.System.loadLibrary(System.java:535)
04-30 11:52:08.623: E/AndroidRuntime(28834):    at com.googlecode.tesseract.android.TessBaseAPI.<clinit>(TessBaseAPI.java:44)
04-30 11:52:08.623: E/AndroidRuntime(28834):    ... 15 more

Help me to solve this problem.. Thank you...

هل كانت مفيدة؟

المحلول

Error message is in your stacktrace:

Caused by: java.lang.UnsatisfiedLinkError: Couldn't load lept: findLibrary returned null

So ensure you got liblept.so in either libs/armeabi or libs/armeabi-v7a in your project. You can also inspect resulting APK to see if liblept.so is there too.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top