mintware-de / flutter_barcode_reader

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

[Bug]scan() return no result #271

Closed function2000 closed 4 years ago

function2000 commented 4 years ago

BUG REPORTS WITHOUT PROVIDING THESE INFORMATIONS WILL BE CLOSED DIRECTLY. DON'T REMOVE THE SECTIONS!

Describe the bug My flutter version 1.17.3, barcode_scan version 3.0.0 or 3.0.1 (works fine for version 2.0.0) scan() triggered, scan screen show, but no result return. Even not go through to the print(result) line.

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior Expert to return the barcode value after scan().

Screenshots If applicable, add screenshots to help explain your problem.

Logs I/Timeline(26658): Timeline: Activity_launch_request time:798169733 intent:Intent { cmp=com.nxxii.sapchart/de.mintware.barcode_scan.BarcodeScannerActivity (has extras) } W/ActivityThread(26658): handleWindowVisibility: no activity for token android.os.BinderProxy@4f37986 D/ViewContentFactory(26658): initViewContentFetcherClass I/ContentCatcher(26658): ViewContentFetcher : ViewContentFetcher D/ViewContentFactory(26658): createInterceptor took 0ms W/CameraHandlerTh(26658): type=1400 audit(0.0:1883053): avc: denied { read } for name="u:object_r:vendor_default_prop:s0" dev="tmpfs" ino=15004 scontext=u:r:untrusted_app:s0:c94,c257,c512,c768 tcontext=u:object_r:vendor_default_prop:s0 tclass=file permissive=0 E/libc (26658): Access denied finding property "vendor.camera.hal1.packagelist" V/CameraPreview(26658): Cancelling autofocus W/Activity(26658): Slow Operation: Activity com.nxxii.sapchart/de.mintware.barcode_scan.BarcodeScannerActivity onPause took 168ms'

Environment (please complete the following information):

Additional context Add any other context about the problem here.

mdryankov commented 4 years ago

Nice one. Somebody must invoke the completion.

hjchen commented 4 years ago

I have the same question!

jifalops commented 4 years ago

Dup of #261?

function2000 commented 4 years ago

Dup of #261?

the error could be the same, but the cause reason is different. My flutter version is 1.17.3.

Cyclonecat commented 4 years ago

android the quesstion! barcode_scan version 3.0.1

W/ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy@123797c V/ActivityThread: callActivityOnCreate D/ActivityThread: add activity client record, r= ActivityRecord{2f639ac token=android.os.BinderProxy@123797c {com.perpetualwave.cloud_intercom/de.mintware.barcode_scan.BarcodeScannerActivity}} token= android.os.BinderProxy@123797c W/WindowDecorActionBar: should not do the transition or the transition anim is null or it is running or the mContainer view is null or mContainer view hasn't been drawn to screen I/Camera: open camera: 0, package name: com.perpetualwave.cloud_intercom I/HwCameraUtil: notifySurfaceFlingerCameraStatus : isFront = false , isOpend = true D/OpenGLRenderer: disableOutlineDraw is true D/HiTouch_PressGestureDetector: onAttached, package=com.perpetualwave.cloud_intercom, windowType=1, mHiTouchRestricted=false D/mali_winsys: EGLint new_window_surface(egl_winsys_display , void , EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000 I/HwViewRootImpl: removeInvalidNode all the node in jank list is out of time V/CameraPreview: Cancelling autofocus W/libEGL: EGLNativeWindowType 0x769e4cd590 disconnect failed W/FirebaseInstanceId: Token retrieval failed without exception message. Will retry token retrieval 2020-08-07 10:48:24.428 26680-26680/com.perpetualwave.cloud_intercom com.perpetualwave.cloud_intercom I/HwCameraUtil: notifySurfaceFlingerCameraStatus : isFront = false , isOpend = false I/HwViewRootImpl: removeInvalidNode all the node in jank list is out of time

[✓] Flutter (Channel master, 1.20.0, on Mac OS X 10.15.5 19F101, locale zh-Hans-CN) • Flutter version 1.20.0 at /Users/cyclonecat/Documents/Flutter/flutter • Framework revision daddc914c7 (8 weeks ago), 2020-06-11 01:35:01 +0200 • Engine revision e8c13aa012 • Dart version 2.9.0 (build 2.9.0-14.0.dev 5c1376615e) • Pub download mirror https://pub.flutter-io.cn • Flutter download mirror https://storage.flutter-io.cn

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2) • Android SDK at /Users/cyclonecat/Library/Android/sdk • Platform android-29, build-tools 29.0.2 • ANDROID_HOME = /Users/cyclonecat/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_242-release-1644-b3-6222593) • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.5) • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 11.5, Build version 11E608c • CocoaPods version 1.8.3

[✓] Android Studio (version 4.0) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin version 47.1.2 • Dart plugin version 193.7361 • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

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

[✓] Connected device (3 available) • BLA AL00 • 5EF7N18110002230 • android-arm64 • Android 10 (API 29) • iPhone XR • 00008020-000805100C91002E • ios • iOS 13.4.1 • iPhone 11 Pro Max • F334998E-1558-4E29-AF0C-0BB489C2EEFF • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-5 (simulator)

• No issues found!

function2000 commented 4 years ago

I also use below plugins in the app: image_pickers: ^1.0.7+6
image_picker: ^0.6.7+4
Is this the reason that make conflict?

ZNBmm commented 4 years ago

@function2000 Same problem! Did you solve it?

ZNBmm commented 4 years ago

MIUI scan code has no result, error Access denied finding property "vendor.camera.aux.packagelist" is reported, Huawei, iOS are normal

function2000 commented 4 years ago

@function2000 Same problem! Did you solve it?

no solution.

function2000 commented 4 years ago

MIUI scan code has no result, error Access denied finding property "vendor.camera.aux.packagelist" is reported, Huawei, iOS are normal

But it works with barcode_scan v2.0

devtronic commented 4 years ago

https://github.com/mintware-de/flutter_barcode_reader/issues/261

jacksun0124 commented 4 years ago

Temp. solution:

  1. Downgrade package from 3.0.1 to 2.0.2;
  2. Change this: await BarcodeScanner.scan().then((res) => barcode = res.rawContent); to this: await BarcodeScanner.scan().then((res) => barcode = res); 3 change this: if (e.code == BarcodeScanner.cameraAccessDenied) { to this: if (e.code == "PERMISSION_NOT_GRANTED") {

It's not a perfect solution, but it works on my app.