我导入了像test-two这样的库,并且还成功分配了ndk构建的路径...我解决了所有的错误..但是一个问题,当我试图运行时,它在捕获的图像后显示错误消息,即“不幸的是简单-Android-OCR已被停止“......我找不到什么错误。 这是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
帮我解决这个问题..谢谢...
答案 0 :(得分:2)
错误消息在您的堆栈跟踪中:
Caused by: java.lang.UnsatisfiedLinkError: Couldn't load lept: findLibrary returned null
因此,请确保项目中的liblept.so
或libs/armeabi
中都有libs/armeabi-v7a
。您还可以检查生成的APK,看看是否还有liblept.so
。