Didn't work any more !
imeDevelopers opened this issue · 11 comments
the plugin didn't work any more ..
the callback function not triggered ...
tried many times, different qr codes , but same results ..
plugin versoin: 2.0.0
test device: Realme 5
android: 10
flutter Version: 1.22.5 stable
dev system: win 10
android studio: 4.1.1
gradle: 6.1.1
compilesdk: 30
targetsdk: 30
Same problem here, not working at all
plugin versoin: 2.0.0
test device: Moto G6+
android: 9
flutter Version: 1.22.5 stable
dev system: MacOs BigSur
android studio: 4.1.1
gradle: 5.4.1
compilesdk: 29
targetsdk: 29
I'm facing the same problem.
plugin versoin: 2.0.0
test device: Mi A3
android: 10
flutter Version: 1.22.5 stable
dev system: MacOs BigSur
android studio: 4.1.1
gradle: 6.7
compilesdk: 30
targetsdk: 30
Hi,
I was able to fix this issue by bumping the gradle dependency version of MLKit.
Go to:
/Users/{username}/.pub-cache/hosted/pub.dartlang.org/qr_mobile_vision-2.0.0/android (on mac)
open build.gradle and change mlkit dependency to latest version.
dependencies {
implementation 'com.google.mlkit:barcode-scanning:16.1.0'
}
Having similar issue, might be connected:
- Samsung S7 - everything works as expected
- OnePlus 6 - doesn't work. Was able to scan few simple barcodes and 0 QR or data matrix codes. It does work with native MLKit sample, so there's a problem in this plugin.
Bumping MLKit version did not fix it.
More info: I went into the plugin and tried to look at the image that's passed to detector. When trying to decodeByteArray into bitmap from image I get null which means bitmap is invalid. There is some data in byte array but it looks lik it's invalid.
WORKING UPDATE: If I force deprecated Camera 1 plugin it works. Obviously not a real fix, but you can test it:
qr_mobile_vision:
git:
url: https://github.com/itsJoKr/flutter_qr_mobile_vision
ref: f72027aec9c147570f7126ac9e1e4265f0bdbf3b
Found a workaround for android. Go to /android/build.gradle and add this to your dependencies:
implementation 'com.google.mlkit:barcode-scanning:16.1.0'
This seems to be device/screen size related. While working fine on a large variety of phones, it was not working on a pixel 5. I think it is related to the size of the preview, beacause it did work on the pixel 5, after changing the dimensions of the camera preview
I'm facing the same issue. Barcode scanning works fine on many Android phones but it does not work on a Pixel 4.
@Manuel-Indlekofer, what did you mean by changing the size of the preview? Did you change the size of the QrCamera widget to a static value?
@gyenesandras yes. For testing purposes i set the preview to a fixed size of 300x600. This worked fine on the pixel5. I also had success using the suggested dependency
implementation 'com.google.mlkit:barcode-scanning:16.1.0'
@gyenesandras yes. For testing purposes i set the preview to a fixed size of 300x600. This worked fine on the pixel5. I also had success using the suggested dependency
implementation 'com.google.mlkit:barcode-scanning:16.1.0'
@Manuel-Indlekofer, thank you!
Hi, any idea how to reproduce this in the emulator? I've tried to make an emulator with screen size 480 x 800, but still can't reproduce the issue.
Hi all, i found a solution long time ago and the plugin works, but i forgot this open issue. so i currently writing this comment when i saw this thread.
Just change the size of camera widget to 600X600 and it will work ...
Put the QrCamera() widget inside Container() widget with height 600
and it will work, thank you.