Open allangaldinosilva opened 2 years ago
Can you clear the cache and try again. It worked for me.
npx react-native start --reset-cache
or
yarn start --reset-cache
or
npm start --reset-cache
I can't fix this error. I need you help me !!!!
@DeepikaSharma5 your suggestion doesn't work to me :(
@allangaldinosilva Why are you using as runOnJS(setValues)(scannedFaces.at(0));
Can you try passing just as runOnJS(setValues)(scannedFaces);
Also have you added import Reanimated from 'react-native-reanimated';
in your file where you are using FrameProcessor
?
If that doesn't work can you try this too,
In your build.gradel
(in android/app
) check if the enableHermes
is false. If not change it to false and try. You need to rebuild the project completely. (Better if you do ./gradlew clean
to android folder before build)
The same issue for IOS. On android works fine.
"react": "17.0.2",
"react-native": "0.68.3",
"react-native-reanimated": "2.10.0",
"react-native-vision-camera": "2.14.1",
"vision-camera-face-detector": "0.1.8"
....
Xcode 14.0 IOS 16 Iphone 8
Also, the same issue has an example from this project
It seems that problem in the main react-native-vision-camera library
@rodgomesc Do you have any idea?
I am facing this issue too, in android. Is there a fix yet?
Faced today with this error after updating ios to 16 and Xcode to 14
For me, I had two bable config files, and I was updating the incorrect file. Updating the correct bable file and re-run the metro was enough
For me, I had two bable config files, and I was updating the incorrect file. Updating the correct bable file and re-run the metro was enough
Could you send to us the correct bable file?
For me, I had two bable config files, and I was updating the incorrect file. Updating the correct bable file and re-run the metro was enough
Could you send to us the correct bable file? the file is
.babelrc
{
"presets": ["module:metro-react-native-babel-preset"],
"plugins": [
[
"module-resolver",
{
"root": ["./src"],
"alias": [
{ "@shared-components": "./src/shared/components" },
{ "@shared-constants": "./src/shared/constants" },
{ "@font-size": "./src/shared/theme/font-size" },
{ "@api": "./src/services/api/index" },
{ "@fonts": "./src/shared/theme/fonts" },
{ "@colors": "./src/shared/theme/colors" },
{ "@theme": "./src/shared/theme" },
{ "@models": "./src/services/models" },
{ "@services": "./src/services" },
{ "@screens": "./src/screens" },
{ "@utils": "./src/utils/" },
{ "@assets": "./src/assets/" },
{ "@event-emitter": "./src/services/event-emitter" },
{ "@local-storage": "./src/services/local-storage" }
],
"extensions": [".js", ".jsx", ".ts", ".tsx"]
}
],
[
"react-native-reanimated/plugin",
{
"globals": ["__scanFaces"]
}
]
]
}
had the same issue on IOS... I saw the exception in the xcode and saw that the babel config was wrong. this solved the problem to me:
"plugins": [
["react-native-reanimated/plugin", {
"globals": [
"__scanFaces"
]
}]
]
have you imported ...'import 'react-native-reanimated';...on top of your index file??
Bug with ios 16 and xcode 14. This solved the problem: https://github.com/mrousavy/react-native-vision-camera/issues/1244#issuecomment-1264383644
Bug with ios 16 and xcode 14. This solved the problem: mrousavy/react-native-vision-camera#1244 (comment)
Thanks, it helps
Bug with ios 16 and xcode 14. This solved the problem: mrousavy/react-native-vision-camera#1244 (comment)
It solves the error for while 👍 thanks
does not work in release build
I resolved the issue by add this line declare function __scanCodes(): void;
to global.d.ts then start with cache reset
does not work in release build
I solved the problem with the release build, added to my root file index.tsx - import 'react-native-reanimated';
on 1 line
Instead of "__scanFaces", you can use "scanFace" from 'vision-camera-face-detector'.
import { scanFaces, Face } from 'vision-camera-face-detector';
After you import "scanFaces" and Face from the above package in Typescript, you can use the bellow code to get the detected face.
const face = scanFaces(frame)[0] as Face
Also, you can use the bellow repository for more detail and example.
nothing works in my case can anyone can please help me to do that?
I fixed my issue after upgrading react-native-vision-camera
to ^2.15.4
I was able to get it working.
"react-native-vision-camera": "^2.16.1",
"react-native-worklets-core": "^0.2.4",
"vision-camera-face-detector": "^0.1.8"
Import the following:
import {scanFaces} from 'vision-camera-face-detector';
Inside your component:
const [faces, setFaces] = useState(null);
const frameProcessor = useFrameProcessor(frame => {
'worklet';
const scannedFaces = scanFaces(frame);
runOnJS(setFaces)(scannedFaces);
}, []);
Hope this helps
I'm facing an error when I try to run the app on Android
error Frame Processor threw an error: Can't find variable: __scanFaces
My environment:
babel.config.js
Metro
I'm using the
FrameProcessor