Announcing the Capacitor ML Kit Barcode Scanning Plugin

isGoogleBarcodeScannerModuleAvailable 717374
ERROR MESSAGE: {“errorMessage”:“Not available on iOS”,“message”:“Not available on iOS”}

I get this error when trying it on iOS, any Idea why ?

It also seems that it doesn’t work in the example project here GitHub - robingenz/capacitor-mlkit-plugin-demo: ⚡️ Simple Ionic Angular app to demonstrate the use of certain Capacitor ML Kit plugins. with iOS 17.0.1 simulators

This method is not available on iOS because it’s not needed. The Google Barcode Scanner Module is an Android SDK. You can just call the scan method on iOS.

For iphone Pro models and some newer Android phones, when attempting to scan very small bar codes, the phones will not focus. Apple describes the issue here starting at 3:33 What’s new in camera capture - WWDC21 - Videos - Apple Developer
So zooming in with the iphone pro is the fix, but there doesn’t seem to be a way to zoom with the capacitor implementation, except that we can possibly set a zoom level before we launch the scanner. Is there another fix for this issue? I can actually recreate the issue using Apple’s built-in QR code scanner that is bundled with the iphone. It won’t scan small qr codes and I can’t zoom with that app either.

Thanks for sharing. Yes, the zoom functionality is still missing. There is already an issue for that: feat: Zoom functionality · Issue #72 · capawesome-team/capacitor-mlkit · GitHub

I receive error “Google Barcode Scanner Module is not available”.

main.03279a7766533c79.js:1 ERROR Error: **The Google Barcode Scanner Module is not available**. You must install it first.
    at returnResult (VM3:912:32)
    at win.androidBridge.onmessage (VM3:887:21)`

Implemented this guide step by step How to build an Ionic Barcode Scanner with Capacitor - Ionic Blog and deployed my app on android real device.

 "@capacitor-mlkit/barcode-scanning": "^5.3.0",
 "@capacitor/android": "^5.6.0",
 "@capacitor/app": "5.0.6",
 "@capacitor/core": "^5.6.0",

Could you please support me? @robingenz


As I said over here, are you calling installGoogleBarcodeScannerModule()?

1 Like

does it support on web too? i get this error when click button

also get this error run on ios

The error itself states that it is not available on this platform. The docs also say “Supports Android and iOS”.

You are going to need to provide more info for anyone to help.


Thanks for reply, so the step that i did is that i run the install command below,

then when rerun again my apps using ionic cap run ios command, i got the error below

im running in ionic 7, im not sure if i missed a step that cause this issue

It seems like this issue is not related to this plugin, see here.

I am using version 6.0.0, and in the Xcode logcat, invoking any BarcodeScanner method displays [error] - {“code”:“UNIMPLEMENTED”}.

I discovered that the issue was due to the version of @capacitor/cli needing to be updated to 6.0.0. After updating to this version, everything worked normally.

1 Like