khjde1207 / tesseract_ocr

Tesseract OCR for flutter
BSD 3-Clause "New" or "Revised" License
62 stars 31 forks source link

app crashes while scanning more images. #33

Open suhail600 opened 1 year ago

suhail600 commented 1 year ago

App crashes while scanning more images like 5 and above , sometimes less than that . The error message is ass follows,

E/ANR_LOG (32360): Current msg <6> = { when=-7s935ms what=2 target=android.hardware.display.DisplayManagerGlobal$DisplayListenerDelegate obj=DisplayInfo{"Built-in screen", displayId 0", displayGroupId 0, FLAG_SECURE, FLAG_SUPPORTS_PROTECTED_BUFFERS, FLAG_TRUSTED, real 1080 x 2412, largest app 2316 x 2268, smallest app 1080 x 936, appVsyncOff 1000000, presDeadline 16666666, mode 2, defaultMode 1, modes [{id=1, width=1080, height=2412, fps=120.00001, alternativeRefreshRates=[60.000004, 60.000004, 72.00001, 90.0, 90.0]}, {id=2, width=1080, height=2412, fps=60.000004, alternativeRefreshRates=[72.00001, 90.0, 90.0, 120.00001, 120.00001]}, {id=3, width=1080, height=2412, fps=72.00001, alternativeRefreshRates=[60.000004, 60.000004, 90.0, 90.0, 120.00001, 120.00001]}, {id=4, width=1080, height=2412, fps=90.0, alternativeRefreshRates=[60.000004, 60.000004, 72.00001, 120.00001, 120.00001]}, {id=5, width=1440, height=3216, fps=60.000004, alternativeRefreshRates=[72.00001, 90.0, 90.0, 120.00001, 120.00001]}, {id=6, width=1440, height=3216, fps=72.00001, alternativeRefreshRates=[60.000004, 60.000004, 60.000004, 90.0, 90.0, 120.00001, 120.00001]}, {id=7, width=1440, height=3216, fps=90.0, alternativeRefreshRates=[60.000004, 60.000004, 60.000004, 72.00001, 120.00001, 120.00001]}, {id=8, width=1440, height=3216, fps=120.00001, alternativeRefreshRates=[60.000004, 60.000004, 60.000004, 72.00001, 90.0, 90.0]}], hdrCapabilities HdrCapabilities{mSupportedHdrTypes=[2, 3, 4], mMaxLuminance=540.0, mMaxAverageLuminance=270.1, mMinLuminance=0.2}, userDisabledHdrTypes [], minimalPostProcessingSupported false, rotation 0, state ON} } E/ANR_LOG (32360): Current msg <7> = { when=-7s935ms what=2 target=android.hardware.display. DisplayManagerGlobal$DisplayListenerDelegate obj=DisplayInfo{"Built-in screen", displayId 0", displayGroupId 0, FLAG_SECURE, FLAG_SUPPORTS_PROTECTED_BUFFERS, FLAG_TRUSTED, real 1080 x 2412, largest app 2316 x 2268, smallest app 1080 x 936, appVsyncOff 1000000, presDeadline 16666666, mode 2, defaultMode 1, modes [{id=1, width=1080, height=2412, fps=120.00001, alternativeRefreshRates=[60.000004, 60.000004, 72.00001, 90.0, 90.0]}, {id=2, width=1080, height=2412, fps=60.000004, alternativeRefreshRates=[72.00001, 90.0, 90.0, 120.00001, 120.00001]}, {id=3, width=1080, height=2412, fps=72.00001, alternativeRefreshRates=[60.000004, 60.000004, 90.0, 90.0, 120.00001, 120.00001]}, {id=4, width=1080, height=2412, fps=90.0, alternativeRefreshRates=[60.000004, 60.000004, 72.00001, 120.00001, 120.00001]}, {id=5, width=1440, height=3216, fps=60.000004, alternativeRefreshRates=[72.00001, 90.0, 90.0, 120.00001, 120.00001]}, {id=6, width=1440, height=3216, fps=72.00001, alternativeRefreshRates=[60.000004, 60.000004, 60.000004, 90.0, 90.0, 120.00001, 120.00001]}, {id=7, width=1440, height=3216, fps=90.0, alternativeRefreshRates=[60.000004, 60.000004, 60.000004, 72.00001, 120.00001, 120.00001]}, {id=8, width=1440, height=3216, fps=120.00001, alternativeRefreshRates=[60.000004, 60.000004, 60.000004, 72.00001, 90.0, 90.0]}], hdrCapabilities HdrCapabilities{mSupportedHdrTypes=[2, 3, 4], mMaxLuminance=540.0, mMaxAverageLuminance=270.1, mMinLuminance=0.2}, userDisabledHdrTypes [], minimalPostProcessingSupported false, rotation 0, state ON} } E/ANR_LOG (32360): Current msg <8> = { when=-7s77ms what=131 target=android.app.ActivityThread$H obj=android.app.ActivityThread$ProviderRefCount@d4077e3 } E/ANR_LOG (32360): Current msg <9> = { when=0 what=0 target=android.os.Handler callback=io.paratoner.flutter_tesseract_ocr.MyRunnable$1 } E/ANR_LOG (32360): >>>CURRENT MSG DUMP OVER<<< I/Quality (32360): Blocked msg = Package name: com.example.alkhaleej [ schedGroup: 5 schedPolicy: 0 ] process the message: { when=-8s54ms what=0 target=android.os.Handler callback=io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0 } took 8046 ms I/Choreographer(32360): Skipped 966 frames! The application may be doing too much work on its main thread. I/Quality (32360): Skipped: false 966 Lost connection to device.

khjde1207 commented 1 year ago

Please do only one task at a time.

suhail600 commented 1 year ago

its just one task after another, not concurrent

laxman-konze commented 5 months ago

Even in single task, app is crashing.

While executing this statement: await recognizer.processImage(imgPath)

Cool-Coder174 commented 1 month ago

I would recommend taking a snapshot and then parsing the task in the queue.