Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Didn't work any more ! #163

Open
imeDevelopers opened this issue Dec 27, 2020 · 11 comments
Open

Didn't work any more ! #163

imeDevelopers opened this issue Dec 27, 2020 · 11 comments

Comments

@imeDevelopers
Copy link

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

@crcaicedo
Copy link

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

@GabrieleVolpato
Copy link

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

@jasondelport
Copy link

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

@itsJoKr
Copy link

itsJoKr commented Jan 19, 2021

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

@TercyoStorck
Copy link

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'

@Manuel-Indlekofer
Copy link

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

@gyenesandras
Copy link

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?

@Manuel-Indlekofer
Copy link

@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
Copy link

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

@andriesatya
Copy link

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.

@imeDevelopers
Copy link
Author

imeDevelopers commented Dec 16, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants