https://kotlinlang.org logo
#ios
Title
# ios
d

Deividas Strioga

03/24/2024, 10:54 PM
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

Stefan Oltmann

03/25/2024, 5:49 PM
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

Deividas Strioga

03/26/2024, 2:13 PM
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

Stefan Oltmann

03/26/2024, 3:55 PM
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.
6 Views