[fix](client): scan QR codes with MLKit's barcode output, not the iOS-only object output

Tapping "Scan a QR code" crashed the app on Android:

    com.facebook.react.common.JavascriptException: Error:
    CameraFactory.createObjectOutput(...): java.lang.Error:
    CameraObjectOutput is not available on Android!

`useObjectOutput` is Apple Vision only — the comment claiming v5 ships a
cross-platform code scanner in core was wrong, and the native factory throws as
soon as the screen mounts. The Barcode Scanner output is the cross-platform one
(MLKit on Android, Vision on iOS); it is attached to the same `<Camera>` via
`outputs`, scans `qr-code` only, and keeps the hand-paste fallback. The scan
callback now takes the barcode values directly instead of the object-output
shape.
This commit is contained in:
2026-10-19 15:18:31 +01:00
parent b5c1710b99
commit b32df04ab9
3 changed files with 36 additions and 22 deletions
+1
View File
@@ -31,6 +31,7 @@
"react-native-screens": "4.25.2",
"react-native-svg": "15.15.5",
"react-native-vision-camera": "5.2.3",
"react-native-vision-camera-barcode-scanner": "5.2.3",
"react-native-worklets": "0.10.0",
"tailwind-merge": "^3.6.0",
"tailwind-variants": "^3.3.1",