Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

App crashes when i use this library without warning or error #141

Open
gpoul1806 opened this issue Mar 30, 2023 · 10 comments
Open

App crashes when i use this library without warning or error #141

gpoul1806 opened this issue Mar 30, 2023 · 10 comments

Comments

@gpoul1806
Copy link

gpoul1806 commented Mar 30, 2023

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);

const [frameProcessor, barcodes] = useScanBarcodes([BarcodeFormat.QR_CODE], {
    checkInverted: true,
});

return
}

@Ho3ein-Boka
Copy link

Same Problem

@rdelao
Copy link

rdelao commented Apr 17, 2023

I am having the same problem, also react-native version "0.70.6"

@ray-holland-es
Copy link

Same, but only on Android. iOS works for me

@ray-holland-es
Copy link

ray-holland-es commented Apr 19, 2023

Maybe merge this? #138

@takeruadelbert
Copy link

takeruadelbert commented May 13, 2023

any update for this issue?
still crashes tho, any help?
@rodgomesc @ray-holland-es @gpoul1806

@takeruadelbert
Copy link

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.

@luatvudinh
Copy link

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.

@takeruadelbert
Copy link

takeruadelbert commented Jun 1, 2023

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.

@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

@professorkolik
Copy link

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

@rznzippy
Copy link

rznzippy commented Aug 8, 2023

Maybe merge this? #138

This changes work for me. I had to apply them manually via patch-package.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants