flutter_qr_mobile_vision icon indicating copy to clipboard operation
flutter_qr_mobile_vision copied to clipboard

Didn't work any more !

Open imeDevelopers opened this issue 4 years ago • 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

imeDevelopers avatar Dec 27 '20 16:12 imeDevelopers

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

crcaicedo avatar Dec 29 '20 03:12 crcaicedo

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

GabrieleVolpato avatar Dec 30 '20 11:12 GabrieleVolpato

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' }

jasondelport avatar Jan 11 '21 09:01 jasondelport

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

itsJoKr avatar Jan 19 '21 16:01 itsJoKr

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'

TercyoStorck avatar Feb 10 '21 16:02 TercyoStorck

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

Manuel-Indlekofer avatar Mar 01 '21 13:03 Manuel-Indlekofer

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 avatar Mar 04 '21 09:03 gyenesandras

@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 avatar Mar 04 '21 10:03 Manuel-Indlekofer

@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!

gyenesandras avatar Mar 04 '21 11:03 gyenesandras

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.

andriesatya avatar Apr 12 '21 03:04 andriesatya

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.

imeDevelopers avatar Dec 16 '21 10:12 imeDevelopers