Open gpoul1806 opened 1 year ago
Same Problem
I am having the same problem, also react-native version "0.70.6"
Same, but only on Android. iOS works for me
Maybe merge this? https://github.com/rodgomesc/vision-camera-code-scanner/pull/138
any update for this issue? still crashes tho, any help? @rodgomesc @ray-holland-es @gpoul1806
any update for this issue? still crashes tho, any help? @rodgomesc @ray-holland-es @gpoul1806
after further debugging almost for a week,I got this solved by either upgrading the react-native-reanimated version or added config in android/build.gradle
.
in my case, the crash happened because of that dependency, not vision-camera-code-scanner.
any update for this issue? still crashes tho, any help? @rodgomesc @ray-holland-es @gpoul1806
after further debugging almost for a week,I got this solved by either upgrading the react-native-reanimated version or added config in
android/build.gradle
. in my case, the crash happened because of that dependency, not vision-camera-code-scanner.
Can you share your react-native-reanimated
version and your "added config in android/build.gradle
?
I has been encountering this issue. Thank you.
any update for this issue? still crashes tho, any help? @rodgomesc @ray-holland-es @gpoul1806
after further debugging almost for a week,I got this solved by either upgrading the react-native-reanimated version or added config in
android/build.gradle
. in my case, the crash happened because of that dependency, not vision-camera-code-scanner.Can you share your
react-native-reanimated
version and your "added config inandroid/build.gradle
? I has been encountering this issue. Thank you.
@luatvudinh I was using react-native-reanimated version 2.14.1
.
in my case either upgrade to 2.14.2
or added this config for still using 2.14.1
project.ext.reanimated = [
buildFromSource: true
]
you need to see what is the error first by debugging or displaying ADB log
Fixed for us by not using the hook useScanBarcodes
but second approach instead
// Alternatively you can use the underlying function:
//
// const frameProcessor = useFrameProcessor((frame) => {
// 'worklet';
// const detectedBarcodes = scanBarcodes(frame, [BarcodeFormat.QR_CODE], { checkInverted: true });
// runOnJS(setBarcodes)(detectedBarcodes);
// }, []);
most likely the reason is different versions of reanimated, though I don't have any proofs
Maybe merge this? #138
This changes work for me. I had to apply them manually via patch-package
.
I use these modules: "react-native": "0.70.6", "react-native-vision-camera": "^2.15.2", "vision-camera-code-scanner": "^0.2.0"
And the app crashes without a warning or an error on the console! P.S. I have asked for camera permission earlier in the app.
Here is my code :
import { useScanBarcodes, BarcodeFormat } from 'vision-camera-code-scanner'; import TextRecognition from '@react-native-ml-kit/text-recognition';
const App = () => { const devices = useCameraDevices(); const device = devices.back; const camera = useRef(null);
return <Camera style={StyleSheet.absoluteFill} device={device} isActive={true} frameProcessor={frameProcessor} frameProcessorFps={5} /> }