mintware-de / flutter_barcode_reader

A flutter plugin for reading 2D barcodes and QR codes.
MIT License
628 stars 463 forks source link

App Crashes whenever I use the scan Android Device only #199

Closed taracell closed 4 years ago

taracell commented 4 years ago

I've been using barcode_scan package for quite a while. The first week of March it stopped working on my android devices. Every time I use the scanner portion of my application the application goes directly to the / route. Is there any way to make this not happen? It works fine on all of my iOS simulators and real devices, however this only happens on all of my Android actual devices not my simulator. It's troubling and I don't know what to do. Below are my flutter Doctor and Android studio logs:

/Users/tara/flutter/bin/flutter doctor --verbose [✓] Flutter (Channel stable, v1.12.13+hotfix.8, on Mac OS X 10.15.3 19D76, locale en-US) • Flutter version 1.12.13+hotfix.8 at /Users/tara/flutter • Framework revision 0b8abb4724 (6 weeks ago), 2020-02-11 11:44:36 -0800 • Engine revision e1e6ced81d • Dart version 2.7.0

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3) • Android SDK at /Users/tara/Library/Android/sdk • Android NDK location not configured (optional; useful for native profiling support) • Platform android-29, build-tools 29.0.3 • ANDROID_HOME = /Users/tara/Library/Android/sdk • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211) • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.4) • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 11.4, Build version 11E146 • CocoaPods version 1.9.0.beta.2

[✓] Android Studio (version 3.6) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin version 44.0.2 • Dart plugin version 192.7761 • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)

[✓] IntelliJ IDEA Ultimate Edition (version 2019.3.3) • IntelliJ at /Applications/IntelliJ IDEA.app • Flutter plugin version 44.0.3 • Dart plugin version 193.6494.35

[✓] VS Code (version 1.42.1) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.8.1

[✓] Connected device (2 available) • SM A205U • R58M967M7DD • android-arm64 • Android 9 (API 28) • Dev iPhone 7 • 0fc3f700c4796c1568ee4730ba67dab6d5cb2967 • ios • iOS 13.3.1s • No issues found! Process finished with exit code 0

This is the snippet from Android studio just before and after using the scanning capability:

D/ViewRootImpl@ffb1efd[MainActivity]: ViewPostIme pointer 0 D/ViewRootImpl@ffb1efd[MainActivity]: ViewPostIme pointer 1 E/AccessibilityBridge: VirtualView node must not be the root node. D/ViewRootImpl@ffb1efd[MainActivity]: ViewPostIme pointer 0 D/ViewRootImpl@ffb1efd[MainActivity]: ViewPostIme pointer 1 E/AccessibilityBridge: VirtualView node must not be the root node. D/ViewRootImpl@ffb1efd[MainActivity]: ViewPostIme pointer 0 D/ViewRootImpl@ffb1efd[MainActivity]: ViewPostIme pointer 1 W/ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy@622f717 I/DecorView: mWindow.mActivityCurrentConfig is null. I/DecorView: updateCaptionType >> DecorView@8de42e9[], isFloating: false, isApplication: true, hasWindowDecorCaption: false, hasWindowControllerCallback: true D/MultiWindowDecorSupport: setCaptionType = 0 D/InputTransport: Input channel constructed: fd=104 D/ViewRootImpl@c10b859[BarcodeScannerActivity]: setView = DecorView@8de42e9[BarcodeScannerActivity] TM=true MM=false D/ViewRootImpl@ffb1efd[MainActivity]: MSG_WINDOW_FOCUS_CHANGED 0 1 D/InputMethodManager: prepareNavigationBarInfo() DecorView@f4ac7c1[MainActivity] D/InputMethodManager: getNavigationBarColor() -855310 D/ViewRootImpl@c10b859[BarcodeScannerActivity]: Relayout returned: old=[0,0][720,1560] new=[0,0][720,1560] result=0x7 surface={true 483190489088} changed=true D/mali_winsys: EGLint new_window_surface(egl_winsys_display , void , EGLSurface, EGLConfig, egl_winsys_surface , EGLBoolean) returns 0x3000 D/OpenGLRenderer: eglCreateWindowSurface = 0x708ebd6e80, 0x708065c010 D/ViewRootImpl@c10b859[BarcodeScannerActivity]: MSG_RESIZED: frame=[0,0][720,1560] ci=[0,53][0,84] vi=[0,53][0,84] or=1 D/ViewRootImpl@c10b859[BarcodeScannerActivity]: MSG_WINDOW_FOCUS_CHANGED 1 1 D/InputMethodManager: prepareNavigationBarInfo() DecorView@8de42e9[BarcodeScannerActivity] getNavigationBarColor() -855310 D/InputMethodManager: prepareNavigationBarInfo() DecorView@8de42e9[BarcodeScannerActivity] getNavigationBarColor() -855310 V/InputMethodManager: Starting input: tba=com.pantry ic=null mNaviBarColor -855310 mIsGetNaviBarColorSuccess true , NavVisible : true , NavTrans : false D/InputMethodManager: startInputInner - Id : 0 I/InputMethodManager: startInputInner - mService.startInputOrWindowGainedFocus D/InputTransport: Input channel constructed: fd=106 D/InputTransport: Input channel destroyed: fd=96 D/SurfaceView: onWindowVisibilityChanged(8) false io.flutter.embedding.android.FlutterSurfaceView{a5fadf9 V.E...... ........ 0,0-720,1476} of ViewRootImpl@ffb1efd[MainActivity] show() Surface(name=SurfaceView - com.pantry/com.pantry.MainActivity@a5fadf9@0[7692])/@0x955213e io.flutter.embedding.android.FlutterSurfaceView{a5fadf9 V.E...... ........ 0,0-720,1476} surfaceDestroyed callback.size 1 #2 io.flutter.embedding.android.FlutterSurfaceView{a5fadf9 V.E...... ........ 0,0-720,1476} W/libEGL: EGLNativeWindowType 0x7094016010 disconnect failed D/SurfaceView: destroy() Surface(name=SurfaceView - com.pantry/com.pantry.MainActivity@a5fadf9@0[7692])/@0x955213e io.flutter.embedding.android.FlutterSurfaceView{a5fadf9 V.E...... ........ 0,0-720,1476} W/libEGL: EGLNativeWindowType 0x70945f4010 disconnect failed D/OpenGLRenderer: eglDestroySurface = 0x709444a600, 0x70945f4000 D/ViewRootImpl@ffb1efd[MainActivity]: Relayout returned: old=[0,0][720,1560] new=[0,0][720,1560] result=0x5 surface={false 0} changed=true D/ViewRootImpl@ffb1efd[MainActivity]: stopped(true) old=false D/SurfaceView: windowStopped(true) false io.flutter.embedding.android.FlutterSurfaceView{a5fadf9 V.E...... ........ 0,0-720,1476} of ViewRootImpl@ffb1efd[MainActivity] D/FlutterView: Detaching from a FlutterEngine: io.flutter.embedding.engine.FlutterEngine@60b77f2 D/FlutterActivityAndFragmentDelegate: Detaching FlutterEngine from the Activity that owns this Fragment. D/FlutterEngine: Destroying. D/FlutterEnginePluginRegistry: Destroying. D/ViewRootImpl@ffb1efd[MainActivity]: dispatchDetachedFromWindow D/InputTransport: Input channel destroyed: fd=89 I/com.pantry: Compiler allocated 4MB to compile void android.view.ViewRootImpl.performTraversals() D/SurfaceView: onWindowVisibilityChanged(0) true me.dm7.barcodescanner.core.CameraPreview{4788c2a V.E...... ......I. 0,0-0,0} of ViewRootImpl@c10b859[BarcodeScannerActivity] D/ViewRootImpl@c10b859[BarcodeScannerActivity]: Relayout returned: old=[0,0][720,1560] new=[0,0][720,1560] result=0x1 surface={true 483190489088} changed=false D/SurfaceView: show() Surface(name=SurfaceView - com.pantry/de.mintware.barcode_scan.BarcodeScannerActivity@4788c2a@0[7692])/@0x484aa1b me.dm7.barcodescanner.core.CameraPreview{4788c2a V.E...... ......ID 0,0-720,1325} D/SurfaceView: surfaceCreated 1 #8 me.dm7.barcodescanner.core.CameraPreview{4788c2a V.E...... ......ID 0,0-720,1325} D/SurfaceView: surfaceChanged (720,1325) 1 #8 me.dm7.barcodescanner.core.CameraPreview{4788c2a V.E...... ......ID 0,0-720,1325} D/SurfaceView: show() Surface(name=SurfaceView - com.pantry/de.mintware.barcode_scan.BarcodeScannerActivity@4788c2a@0[7692])/@0x484aa1b me.dm7.barcodescanner.core.CameraPreview{4788c2a V.E...... ......ID 0,0-745,1325} D/SurfaceView: surfaceChanged (745,1325) 1 #5 me.dm7.barcodescanner.core.CameraPreview{4788c2a V.E...... ......ID 0,0-745,1325} D/ViewRootImpl@c10b859[BarcodeScannerActivity]: ViewPostIme pointer 0 D/ViewRootImpl@c10b859[BarcodeScannerActivity]: ViewPostIme pointer 1 W/ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy@821536c D/FlutterActivity: Using the launch theme as normal theme. D/FlutterActivityAndFragmentDelegate: Setting up FlutterEngine. No preferred FlutterEngine was provided. Creating a new FlutterEngine for this FlutterFragment. D/FlutterActivityAndFragmentDelegate: Attaching FlutterEngine to the Activity that owns this Fragment. I/DecorView: mWindow.mActivityCurrentConfig is null. I/DecorView: updateCaptionType >> DecorView@2ad6300[], isFloating: false, isApplication: true, hasWindowDecorCaption: false, hasWindowControllerCallback: true D/MultiWindowDecorSupport: setCaptionType = 0 D/InputTransport: Input channel constructed: fd=92 D/ViewRootImpl@7d32df5[MainActivity]: setView = DecorView@2ad6300[MainActivity] TM=true MM=false D/ViewRootImpl@c10b859[BarcodeScannerActivity]: MSG_WINDOW_FOCUS_CHANGED 0 1 D/InputMethodManager: prepareNavigationBarInfo() DecorView@8de42e9[BarcodeScannerActivity] getNavigationBarColor() -855310 D/FlutterView: Attaching to a FlutterEngine: io.flutter.embedding.engine.FlutterEngine@d69678a D/FlutterActivityAndFragmentDelegate: Executing Dart entrypoint: main, and sending initial route: / D/SurfaceView: onWindowVisibilityChanged(0) true io.flutter.embedding.android.FlutterSurfaceView{8f5b471 V.E...... ......I. 0,0-0,0} of ViewRootImpl@7d32df5[MainActivity] D/ViewRootImpl@7d32df5[MainActivity]: Relayout returned: old=[0,0][720,1560] new=[0,0][720,1560] result=0x7 surface={true 483328139264} changed=true D/mali_winsys: EGLint new_window_surface(egl_winsys_display , void , EGLSurface, EGLConfig, egl_winsys_surface , EGLBoolean) returns 0x3000 D/OpenGLRenderer: eglCreateWindowSurface = 0x709444ab00, 0x70889a2010 D/SurfaceView: show() Surface(name=SurfaceView - com.pantry/com.pantry.MainActivity@8f5b471@0[7692])/@0xdfe7256 io.flutter.embedding.android.FlutterSurfaceView{8f5b471 V.E...... ......ID 0,0-720,1476} D/SurfaceView: surfaceCreated 1 #8 io.flutter.embedding.android.FlutterSurfaceView{8f5b471 V.E...... ......ID 0,0-720,1476} D/mali_winsys: EGLint new_window_surface(egl_winsys_display , void , EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000 D/SurfaceView: surfaceChanged (720,1476) 1 #8 io.flutter.embedding.android.FlutterSurfaceView{8f5b471 V.E...... ......ID 0,0-720,1476} D/ViewRootImpl@7d32df5[MainActivity]: Relayout returned: old=[0,0][720,1560] new=[0,0][720,1560] result=0x3 surface={true 483328139264} changed=false D/ViewRootImpl@7d32df5[MainActivity]: MSG_RESIZED: frame=[0,0][720,1560] ci=[0,53][0,84] vi=[0,53][0,84] or=1 MSG_WINDOW_FOCUS_CHANGED 1 1 D/InputMethodManager: prepareNavigationBarInfo() DecorView@2ad6300[MainActivity] getNavigationBarColor() -855310 D/InputMethodManager: prepareNavigationBarInfo() DecorView@2ad6300[MainActivity] D/InputMethodManager: getNavigationBarColor() -855310 V/InputMethodManager: Starting input: tba=com.pantry ic=null mNaviBarColor -855310 mIsGetNaviBarColorSuccess true , NavVisible : true , NavTrans : false D/InputMethodManager: startInputInner - Id : 0 I/InputMethodManager: startInputInner - mService.startInputOrWindowGainedFocus D/InputTransport: Input channel constructed: fd=98 D/InputTransport: Input channel destroyed: fd=106 D/SurfaceView: onWindowVisibilityChanged(8) false me.dm7.barcodescanner.core.CameraPreview{4788c2a V.E...... ........ 0,0-745,1325} of ViewRootImpl@c10b859[BarcodeScannerActivity] D/SurfaceView: show() Surface(name=SurfaceView - com.pantry/de.mintware.barcode_scan.BarcodeScannerActivity@4788c2a@0[7692])/@0x484aa1b me.dm7.barcodescanner.core.CameraPreview{4788c2a V.E...... ........ 0,0-745,1325} D/SurfaceView: surfaceDestroyed callback.size 0 #2 me.dm7.barcodescanner.core.CameraPreview{4788c2a V.E...... ........ 0,0-745,1325} D/SurfaceView: destroy() Surface(name=SurfaceView - com.pantry/de.mintware.barcode_scan.BarcodeScannerActivity@4788c2a@0[7692])/@0x484aa1b me.dm7.barcodescanner.core.CameraPreview{4788c2a V.E...... ........ 0,0-745,1325} W/libEGL: EGLNativeWindowType 0x708065c010 disconnect failed D/OpenGLRenderer: eglDestroySurface = 0x708ebd6e80, 0x708065c000 D/ViewRootImpl@c10b859[BarcodeScannerActivity]: Relayout returned: old=[0,0][720,1560] new=[0,0][720,1560] result=0x5 surface={false 0} changed=true D/ViewRootImpl@c10b859[BarcodeScannerActivity]: stopped(true) old=false D/SurfaceView: windowStopped(true) false me.dm7.barcodescanner.core.CameraPreview{4788c2a V.E...... ........ 0,0-745,1325} of ViewRootImpl@c10b859[BarcodeScannerActivity] D/ViewRootImpl@c10b859[BarcodeScannerActivity]: dispatchDetachedFromWindow D/InputTransport: Input channel destroyed: fd=104 E/AccessibilityBridge: VirtualView node must not be the root node. E/AccessibilityBridge: VirtualView node must not be the root node. E/AccessibilityBridge: VirtualView node must not be the root node. I/chatty: uid=10224(com.pantry) identical 1 line

devtronic commented 4 years ago

Please try this fix: https://github.com/mintware-de/flutter_barcode_reader/pull/186

Or the upcoming version: https://github.com/mintware-de/flutter_barcode_reader/pull/185

taracell commented 4 years ago

I tried fix #186 It doesn't work. I will try #185. Thank you!

devtronic commented 4 years ago

The current dev version should fix the problem: https://pub.dev/packages/barcode_scan/versions/3.0.0-dev.1