我从以下位置下载了 tesseract android 工具:https ://github.com/rmtheis/tess-two/
我使用给出的步骤正确编译了它:ndk-build android update project --path。蚂蚁释放
然后我将此添加为我从以下位置下载的示例 ocr 测试应用程序的库: https ://github.com/rmtheis/android-ocr/
我将 tess-two 库添加到此示例 ocr 测试应用程序中。但是每当我尝试在我的设备上运行此应用程序时,我的 logcat 上都会出现以下错误,请帮助我解决这个问题:
07-10 01:13:10.901: E/AndroidRuntime(9394): FATAL EXCEPTION: AsyncTask #1
07-10 01:13:10.901: E/AndroidRuntime(9394): java.lang.RuntimeException: An error occured while executing doInBackground()
07-10 01:13:10.901: E/AndroidRuntime(9394): at android.os.AsyncTask$3.done(AsyncTask.java:299)
07-10 01:13:10.901: E/AndroidRuntime(9394): at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
07-10 01:13:10.901: E/AndroidRuntime(9394): at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
07-10 01:13:10.901: E/AndroidRuntime(9394): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
07-10 01:13:10.901: E/AndroidRuntime(9394): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
07-10 01:13:10.901: E/AndroidRuntime(9394): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
07-10 01:13:10.901: E/AndroidRuntime(9394): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
07-10 01:13:10.901: E/AndroidRuntime(9394): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
07-10 01:13:10.901: E/AndroidRuntime(9394): at java.lang.Thread.run(Thread.java:856)
07-10 01:13:10.901: E/AndroidRuntime(9394): Caused by: java.lang.NoClassDefFoundError: org.xeustechnologies.jtar.TarInputStream
07-10 01:13:10.901: E/AndroidRuntime(9394): at edu.sfsu.cs.orange.ocr.OcrInitAsyncTask.getTarSizeUncompressed(OcrInitAsyncTask.java:574)
07-10 01:13:10.901: E/AndroidRuntime(9394): at edu.sfsu.cs.orange.ocr.OcrInitAsyncTask.untar(OcrInitAsyncTask.java:520)
07-10 01:13:10.901: E/AndroidRuntime(9394): at edu.sfsu.cs.orange.ocr.OcrInitAsyncTask.doInBackground(OcrInitAsyncTask.java:221)
07-10 01:13:10.901: E/AndroidRuntime(9394): at edu.sfsu.cs.orange.ocr.OcrInitAsyncTask.doInBackground(OcrInitAsyncTask.java:1)
07-10 01:13:10.901: E/AndroidRuntime(9394): at android.os.AsyncTask$2.call(AsyncTask.java:287)
07-10 01:13:10.901: E/AndroidRuntime(9394): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
07-10 01:13:10.901: E/AndroidRuntime(9394): ... 5 more
07-10 01:13:19.986: E/WindowManager(9394): Activity edu.sfsu.cs.orange.ocr.CaptureActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@41cf59d8 that was originally added here
07-10 01:13:19.986: E/WindowManager(9394): android.view.WindowLeaked: Activity edu.sfsu.cs.orange.ocr.CaptureActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@41cf59d8 that was originally added here
07-10 01:13:19.986: E/WindowManager(9394): at android.view.ViewRootImpl.<init>(ViewRootImpl.java:412)
07-10 01:13:19.986: E/WindowManager(9394): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:312)
07-10 01:13:19.986: E/WindowManager(9394): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:224)
07-10 01:13:19.986: E/WindowManager(9394): at android.view.WindowManagerImpl$CompatModeWrapper.addView(WindowManagerImpl.java:149)
07-10 01:13:19.986: E/WindowManager(9394): at android.view.Window$LocalWindowManager.addView(Window.java:554)
07-10 01:13:19.986: E/WindowManager(9394): at android.app.Dialog.show(Dialog.java:277)
07-10 01:13:19.986: E/WindowManager(9394): at edu.sfsu.cs.orange.ocr.CaptureActivity.initOcrEngine(CaptureActivity.java:698)
07-10 01:13:19.986: E/WindowManager(9394): at edu.sfsu.cs.orange.ocr.CaptureActivity.onResume(CaptureActivity.java:371)
07-10 01:13:19.986: E/WindowManager(9394): at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1199)
07-10 01:13:19.986: E/WindowManager(9394): at android.app.Activity.performResume(Activity.java:5280)
07-10 01:13:19.986: E/WindowManager(9394): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2606)
07-10 01:13:19.986: E/WindowManager(9394): at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2644)
07-10 01:13:19.986: E/WindowManager(9394): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2130)
07-10 01:13:19.986: E/WindowManager(9394): at android.app.ActivityThread.access$600(ActivityThread.java:140)
07-10 01:13:19.986: E/WindowManager(9394): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1227)
07-10 01:13:19.986: E/WindowManager(9394): at android.os.Handler.dispatchMessage(Handler.java:99)
07-10 01:13:19.986: E/WindowManager(9394): at android.os.Looper.loop(Looper.java:137)
07-10 01:13:19.986: E/WindowManager(9394): at android.app.ActivityThread.main(ActivityThread.java:4898)
07-10 01:13:19.986: E/WindowManager(9394): at java.lang.reflect.Method.invokeNative(Native Method)
07-10 01:13:19.986: E/WindowManager(9394): at java.lang.reflect.Method.invoke(Method.java:511)
07-10 01:13:19.986: E/WindowManager(9394): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1008)
07-10 01:13:19.986: E/WindowManager(9394): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:775)
07-10 01:13:19.986: E/WindowManager(9394): at dalvik.system.NativeStart.main(Native Method)
07-10 01:13:19.991: E/WindowManager(9394): Activity edu.sfsu.cs.orange.ocr.CaptureActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@41d02180 that was originally added here
07-10 01:13:19.991: E/WindowManager(9394): android.view.WindowLeaked: Activity edu.sfsu.cs.orange.ocr.CaptureActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@41d02180 that was originally added here
07-10 01:13:19.991: E/WindowManager(9394): at android.view.ViewRootImpl.<init>(ViewRootImpl.java:412)
07-10 01:13:19.991: E/WindowManager(9394): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:312)
07-10 01:13:19.991: E/WindowManager(9394): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:224)
07-10 01:13:19.991: E/WindowManager(9394): at android.view.WindowManagerImpl$CompatModeWrapper.addView(WindowManagerImpl.java:149)
07-10 01:13:19.991: E/WindowManager(9394): at android.view.Window$LocalWindowManager.addView(Window.java:554)
07-10 01:13:19.991: E/WindowManager(9394): at android.app.Dialog.show(Dialog.java:277)
07-10 01:13:19.991: E/WindowManager(9394): at edu.sfsu.cs.orange.ocr.OcrInitAsyncTask.onPreExecute(OcrInitAsyncTask.java:113)
07-10 01:13:19.991: E/WindowManager(9394): at android.os.AsyncTask.executeOnExecutor(AsyncTask.java:586)
07-10 01:13:19.991: E/WindowManager(9394): at android.os.AsyncTask.execute(AsyncTask.java:534)
07-10 01:13:19.991: E/WindowManager(9394): at edu.sfsu.cs.orange.ocr.CaptureActivity.initOcrEngine(CaptureActivity.java:716)
07-10 01:13:19.991: E/WindowManager(9394): at edu.sfsu.cs.orange.ocr.CaptureActivity.onResume(CaptureActivity.java:371)
07-10 01:13:19.991: E/WindowManager(9394): at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1199)
07-10 01:13:19.991: E/WindowManager(9394): at android.app.Activity.performResume(Activity.java:5280)
07-10 01:13:19.991: E/WindowManager(9394): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2606)
07-10 01:13:19.991: E/WindowManager(9394): at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2644)
07-10 01:13:19.991: E/WindowManager(9394): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2130)
07-10 01:13:19.991: E/WindowManager(9394): at android.app.ActivityThread.access$600(ActivityThread.java:140)
07-10 01:13:19.991: E/WindowManager(9394): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1227)
07-10 01:13:19.991: E/WindowManager(9394): at android.os.Handler.dispatchMessage(Handler.java:99)
07-10 01:13:19.991: E/WindowManager(9394): at android.os.Looper.loop(Looper.java:137)
07-10 01:13:19.991: E/WindowManager(9394): at android.app.ActivityThread.main(ActivityThread.java:4898)
07-10 01:13:19.991: E/WindowManager(9394): at java.lang.reflect.Method.invokeNative(Native Method)
07-10 01:13:19.991: E/WindowManager(9394): at java.lang.reflect.Method.invoke(Method.java:511)
07-10 01:13:19.991: E/WindowManager(9394): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1008)
07-10 01:13:19.991: E/WindowManager(9394): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:775)
07-10 01:13:19.991: E/WindowManager(9394): at dalvik.system.NativeStart.main(Native Method)