Hey, I keep struggling to use a barcode scanner on...
# ios
d
Hey, I keep struggling to use a barcode scanner on iOS side of KMM. I am trying google ml kit scanner, but after adding a pod dependency and using some class from this lib in the code, facing a build time error
Could not find or use auto-linked framework 'MLKitBarcodeScanning': framework 'MLKitBarcodeScanning' not found
Undefined symbol: _OBJC_CLASS_$_MLKBarcodeScanner
I have tried various tips on similar issues all over the web to no avail. Did any of you face anything like this?
s
I wasn’t able to use Google ML Kit iOS for face recognition. I think it’s just broken and deprecated. Use Apple Vision on iOS (VNDetectBarcodesRequest) and forget about ML Kit there. I use ML Kit only on Android.
d
Thanks for the answer Stefan. I need to have live preview integrated into the app layout, and
VNDetectBarcodesRequest
sounds like it does not provide such functionality. I guess my other option is to create a separate iOS lib, which uses swift based Vision APIs, and import it to the kmm project. Or try using iOS framework AV for camera preview, and some java lib (zxing) for parsing of each frame ByteArray Sounds like I could combine iOS
AV
framework with this lib framework as well. I guess that's what you meant
s
Not entirely sure if we are on the same page here, but I was able to use
VNDetectFaceCaptureQualityRequest
in my
iosMain
code. Directly in Kotlin.
VNDetectBarcodesRequest
sounds like it does provide what you want.