Closed spsaucier closed 10 months ago
I saw the following response on another thread and will try it shortly.
> Yes, that one works nicely. I had to upgrade react native to 0.72.5 though.
Well I just tried it on Android and it crashed the whole app after ~1 sec of code scanning. Guess I'll be staying with v2 a little longer.
Found what's wrong:
babel.config.js
should look like this
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
plugins: [['react-native-worklets-core/plugin'], ['react-native-reanimated/plugin']],
};
Originally posted by @zzz08900 in https://github.com/mrousavy/react-native-vision-camera/issues/1985#issuecomment-1759653565
i have same problem also on ios, it works in debug mode but not in release mode. i get the same error when the camera starts
Edit: Updating to Reanimated v3 (latest) did fix the crash!
Now though it keeps giving this error repeatedly (no crash though):
ERROR Frame Processor threw an error: Cannot read property 'map' of undefined
And later I discovered there's still crash in release builds for Android if you use reanimated(whatever version) with vision camera v3 and frame processor. Debug builds works fine though.
The only valid solution as of now is to remove reanimated, which is not always possible.
It looks like react-native-worklets-core
is still messed up by reanimated in some way. Needs more digging.
FYI you can make a patch-package for vision camera v2.15.x to fix the iOS17/iPhone 15 crash, and stick to old old vision-camera-code-scanner until v3 or react-native-worklets-core
gains more compatibility.
I believe those two commits are what you need to make a patch for v2.15.x https://github.com/mrousavy/react-native-vision-camera/commit/503114b9d1c61d60fa3c69b3bd4cb084758fbf5b https://github.com/mrousavy/react-native-vision-camera/commit/2ae4439c844e62131f76d35ffeca76f5a1c7237f
Yeah, I already did it and I'm just playing with v3 to try things out.
this was the fix for me: https://github.com/mrousavy/react-native-vision-camera/issues/1776#issuecomment-1757204827
I have update the lib to support the latest version of react-native-vision-camera https://github.com/mgcrea/vision-camera-barcode-scanner/releases/tag/0.6.1, please reopen if you encounter new issues.
On my Android device (Moto G Stylus 2022), when I include this scanner in the Camera, it opens for a second or two, but then always crashes with the following message:
Calling code:
With this same setup, Camera is working when I comment out the
{...cameraProps}
line in<Camera />
.Aside: I wasn't able to get the example app working to reproduce this, unfortunately -- I kept getting this error in Metro: