mintware-de / flutter_barcode_reader

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

[Bug] BarcodeScanner.scan() does not return a result on Android since 3.0.0 #222

Closed lwky closed 4 years ago

lwky commented 4 years ago

Describe the bug BarcodeScanner.scan() never returns. The scanner opens, it successfully scans a barcode, the viewfinder is hidden again, but the ScanResult future never completes.

Environment flutter stable 1.12.13+hotfix.9 debugmode android 6.0 works fine running barcode_scan 2.0.2

Additional context BarcodeScannerActivity::handleResult() calls finish() with the expected barcode

ActivityHelper::onActivityResult() does not get called ScanResultHandler::onActivityResult() does not get called

I have no kotlin experience but I can always test some more stuff if someone points me in the right direction :)

adrian-stanescu commented 4 years ago

I can confirm this happens for me as well for Android device

devtronic commented 4 years ago

See the upgrade guide: https://github.com/mintware-de/flutter_barcode_reader/blob/master/UPGRADE.md

You need to update your project to Flutter 1.12+. (Not only the Flutter tools itself)

BAndonovski commented 4 years ago

I'm using Flutter 1.12.13+hotfix.9 and can still reproduce the issue.

devtronic commented 4 years ago

Please see the upgrade guide. As written, you also need to update the Project itself to Flutter 1.12+

lwky commented 4 years ago

I'm using Flutter 1.12.13+hotfix.9 and can still reproduce the issue.

I think @devtronic is referring to this line:

If you flutter created your project prior to version 1.12, this may apply to your project

I created my project half a year ago so this applies to me as well. Thanks 👍

marchacio commented 4 years ago

I solved downgrading barcode_scan from 3.0.1 (current version) to 2.0.0.

I hope it helps

sz7i commented 4 years ago

What was really necessary is to go through this process https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects, which was referenced from the barcode scanner upgrade guide.