Google ML kit Barcode Scanner example app for android not able to detect barcodes

On the first part of the question "Waiting for the barcode detection model to be downloaded. Please wait.":

This can happen if there is not enough storage on the device or the data connection is not there on the device. Clear out the data of the Google Play Services and retrying should work:

Settings->Apps->Google Play Services->Storage->Manage Space->Clear All Data

On the meta-data tag in the manifest part of the question:

That helps with the production use case i.e. when the end-user installs the app from the Play Store, the models are downloaded at install time with that meta-data tag. However, during the development you still have to wait for the model to be downloaded once.

On the last part of the question about Dynamite module loading error (I don't have enough reputation to add a comment yet, so adding it here):

What Android version and the Google Play services version are you running?


Add this dependency. It worked for me.

implementation 'com.google.firebase:firebase-ml-vision-barcode-model:16.0.2'