https://github.com/rmtheis/tess-two/からtesseract Androidツールをダウンロードしました
指定された手順を使用して適切にコンパイルしました:ndk-build android update project --path。アリリリース
次に、 https ://github.com/rmtheis/android-ocr/からダウンロードしたサンプルocrテストアプリケーションのライブラリとしてこれを追加しました
このサンプル ocr テスト アプリケーションに tess-two ライブラリを追加しました。しかし、デバイスでこのアプリケーションを実行しようとすると、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)