Open kometen opened 1 year ago
Downgrading to beta1 works!?!?
dependencies {
implementation 'com.google.android.gms:play-services-code-scanner:16.0.0-beta1'
}
But after the app runs and I can scan a QR-code, then clear the Google Play searvices cache and restart the app I am getting the same error. So it does not seem it's the app but rather a constraint on the delivery-side (Google) that causes the issue.
How can I bundle the Barcode UI with the app rather than the unreliable delivery-side?
So:
I have the same issue. I configured the mete-data tag in the AndroidManifest.xml, but the dependency is not automatically downloaded. Only when the user wants to use the Scanner for the first time, the download of the required models is triggered. A couple of seconds later, on a second try, the Scanner (most of the time) works. So it seems the pre-download (when the app is downloaded from the Play Store) does not work.
Is there a way can this issue be resolved. I am using the below dependency : implementation 'com.google.android.gms:play-services-code-scanner:16.0.0'
OmniDirectional barcode is not scanned by Google code scanner. I tried to scan barcode from below url, no scan results were produced after scan: https://www.gs1.org/standards/barcodes/databar Please help me regarding this issue
Same for Android 11 (Samsung Galaxy A50) and Android 13 (Samsung Galaxy A14 5G).
Ist there a chance anybody will look at it? Or should I use plain good old methods?
Running into the same issue on a Galaxy S20 (Android 13).
I'm using implementation 'com.google.android.gms:play-services-code-scanner:16.0.0'
It was working last week, then over the weekend device did a system update (coincidence?) Anyway, I cleared PlayStore cache, rebooted, made sure I have the latest version of PlayStore. No luck! I also downgraded to the beta release with no luck.
Looking more and more like I'll have to go back to the old way of doing it. :(
I had the problem MlKitException: Failed to scan code
. It seems to be some google bug which sometimes happen. In my case google code scanner was working one day but on the next day does not without any code change. I just deleted data of Google Play services
app. After that I got error CODE_SCANNER_UNAVAILABLE
(Required code scanner module is not available yet) see https://developers.google.com/android/reference/com/google/mlkit/common/MlKitException and this means that just wait a few seconds and try again and google code scanner will work - this is just in local development when app is not installed via play store. In usual case google installs code scanner with app if you have <meta-data android:name="com.google.mlkit.vision.DEPENDENCIES" android:value="barcode_ui" />
in AndroidManifest.xml.
Great to debug is android app in play store https://play.google.com/store/apps/details?id=com.khandev.qrcodescanner which uses google code scanner library. You can test that when you delete play services data and install that app from play store and open it after several second later google code scanner is working so lib was pre-installed with app before first app use.
So implement manual downloading by this doc https://developers.google.com/android/guides/module-install-apis is useless. In local dev after first use you will got CODE_SCANNER_UNAVAILABLE
and later it will work whe google downloads it.
This problem also occurs if you attempt to use your own implementation of the Google Play Services code scanner com.google.android.gms:play-services-code-scanner:16.1.0
.
Conceptually, you need to check the availability of the scanner, install the module if it is not available, and then you can supposedly use the scanner in the OnSuccessListener
. Unfortunately directly after that success callback (meaning the module has been installed) or even with a slight delay, you will still get the error com.google.mlkit.common.MlKitException: Waiting for the Barcode UI module to be downloaded.
when starting the scanner. This should clear up 'in a bit' when that module has been installed in the background.
It would be incredibly helpful if we could also install the Barcode UI module
using the ModuleInstallClient
, but I haven't found a way to do so yet.
@rvanderlinden I do not think we must install something. It is enough Google to fix bug when we use <meta-data android:name="com.google.mlkit.vision.DEPENDENCIES" android:value="barcode_ui" />
by doc it must be installed automatically within app installation. This lib was designed to be easy to use but Google MUST fix bugs and reliability. We do not need to take care manually about lib checking, installation, download progress etc.... too complicated.
Same issue here, no matter how much I wait I keep getting
com.google.mlkit.common.MlKitException: Waiting for the Barcode UI module to be downloaded.
Also added the
on the manifest and nothing.
In my case it started to work when I turned on the internet connection on my device
I am running the codescanner-project
mlkit/android/codescanner
on a Samsung Galaxy A40 running Android 11 with latest updates installed. The device is only for testing, connected to wifi, no login to any service nor any sim-card. There is 46 GB available diskspace.The app is installed via android studio Electric Eel and usb.
I have added the following to settings.gradle.
build.gradle (project):
build.gradle (code-scanner-sample)
AndroidManifest.xml: