capawesome-team / capacitor-mlkit

⚡️ ML Kit plugins for Capacitor. Supports Android and iOS.
https://capawesome.io/plugins/mlkit/
Apache License 2.0
147 stars 46 forks source link

bug: startScan can not scan long text qrcode #136

Closed TheSoils closed 8 months ago

TheSoils commented 8 months ago

Plugin(s)

Version

5.4.0

Platform(s)

Current behavior

when i startScan a qrcode that encode a 341 character string on android phone, the android logcat show Notifying listeners for event barcodeScanned, but listeners function doesnt get the scan result. It can scan success with readBarcodesFromImage This is the qrcode and logcat. my device is xiaomi 12 ,android 14,the device dont have google play , so use startScan image image

Expected behavior

barcodeScanned listener get the scan result.

Reproduction

https://github.com/robingenz/capacitor-mlkit-plugin-demo

Steps to reproduce

1.pull the demo project 2.build and run on android device

  1. startScan a long content qrcode

Other information

two test device is xiaomi 12 android 14 api34 huawei got-w09 android 12 api31

Capacitor doctor

[warn] The bundledWebRuntime configuration option has been deprecated. Can be safely deleted. 💊 Capacitor Doctor 💊

Latest Dependencies:

@capacitor/cli: 5.7.2 @capacitor/core: 5.7.2 @capacitor/android: 5.7.2 @capacitor/ios: 5.7.2

Installed Dependencies:

@capacitor/cli: 5.4.1 @capacitor/core: 5.4.1 @capacitor/android: 5.4.1 @capacitor/ios: 5.4.1

[success] iOS looking great! 👌 [success] Android looking great! 👌

Before submitting

robingenz commented 8 months ago

I was able to reproduce your issue. But this is only an issue in the demo app, not in the barcode scanning plugin. The qrcode is recognized, but only if you are close enough with the camera. Then, however, the detection area of the demo app is too small. The demo app only serves as a demo, not as a finished app. If you need to scan barcodes with a lot of information, you can simply make the detection area larger in your app.