mrousavy / react-native-vision-camera

📸 A powerful, high-performance React Native Camera library.
https://react-native-vision-camera.com
MIT License
7.35k stars 1.07k forks source link

🐛[v2.16.2] Frame Processors are not enabled #1937

Closed pasquale95 closed 11 months ago

pasquale95 commented 11 months ago

What's happening?

I updated the react-native-vision-camera from 2.15.4 to 2.16.2 to overcome the load+ problem on iOS, but after the update the camera stops working as soon as I open it on both iOS and Android. I also tried to use the version 2.16.1 and the issue still persists. The 2.16.2 version should not require react-native-worklets-core, right? This should be mandatory from v3.

Reproduceable Code

const [frameProcessor, barcodes] = useScanBarcodes([BarcodeFormat.QR_CODE], {
    checkInverted: true,
  });
useEffect(() => {
    (async () => {
      const status = await Camera.requestCameraPermission();
      setHasPermission(status === 'authorized');
    })();
  }, []);
return device != null && hasPermission ? (
    <Camera
      style={styles.scanner}
      device={device}
      isActive={isFocused}
      frameProcessor={frameProcessor}
      frameProcessorFps={5}
    />
  ) : null;

Relevant log output

ERROR  frame-processor/unavailable: Frame Processors are not enabled. See https://react-native-vision-camera.com/docs/guides/troubleshooting, js engine: hermes

Camera Device

{
   "maxZoom":8,
   "minZoom":1,
   "supportsLowLightBoost":false,
   "supportsDepthCapture":false,
   "neutralZoom":1,
   "supportsFocus":true,
   "supportsRawCapture":false,
   "hasFlash":true,
   "name":"back (0)",
   "supportsParallelVideoProcessing":false,
   "isMultiCam":false,
   "hasTorch":true,
   "devices":[
      "wide-angle-camera"
   ],
   "position":"back",
   "id":"0"
}

Device

SM-A336B - Android 13

VisionCamera Version

2.16.2

Other useful info

react-native: 0.70.13 react-native-reanimated: 2.17.0

Can you reproduce this issue in the VisionCamera Example app?

I didn't try (⚠️ your issue might get ignored & closed if you don't try this)

Additional information

2sem commented 11 months ago

Xcode 14.3.1 reanimated: 2.9.1

should I upgrade reanimated to v3??

Screen Shot 2023-10-06 at 10 27 55 AM

ombogdanJoinToIt commented 11 months ago

same issue

fedpre commented 11 months ago

I think I have a similar issue where after upgrading to get rid of the Xcode 15 problem, the frame processor doesn't recognize my custom frame processor anymore. I cannot share code because it is proprietary of the company I am developing for, but I have created a bodyPose for iOS frame processor and now when I try to activate it it says that it doesn't find it. I have added it to the globals plugins and it was working before the change.

podger commented 11 months ago

Since version 2.16.0 react-native-reanimanted 3.5+ is needed for the Frame Processors to be enabled.

ongdetui commented 11 months ago

same issue. frame-processor/unavailable: Frame Processors are not enabled. using reanimanted v3 ?

Danushka96 commented 11 months ago

Since version 2.16.0 react-native-reanimanted 3.5+ is needed for the Frame Processors to be enabled.

Works for me

pasquale95 commented 11 months ago

Since version 2.16.0 react-native-reanimanted 3.5+ is needed for the Frame Processors to be enabled.

If I switch to the latest react-native-reanimated 3.5.4 I get this error coming from react-native-vision-camera:

  CMake Error at CMakeLists.txt:208 (find_package):
    Could not find a package configuration file provided by
    "react-native-reanimated" with any of the following names:

      react-native-reanimatedConfig.cmake
      react-native-reanimated-config.cmake

    Add the installation prefix of "react-native-reanimated" to
    CMAKE_PREFIX_PATH or set "react-native-reanimated_DIR" to a directory
    containing one of the above files.  If "react-native-reanimated" provides a
    separate development package or SDK, be sure it has been installed.
mrousavy commented 11 months ago

Reanimated 3 is required for VisionCamera 2.16.

I really recommend you guys to upgrade to VisionCamera V3

fedpre commented 11 months ago

@mrousavy that's actually what I have suggested to my company and gave me the green light. I will updated several other stuff including to VisionCamera V3, as it seems that the frameprocessor issue that I had were resolved in the latest releases. Excited to see it in action.

mrousavy commented 11 months ago

& V3 now has a QR/Barcode scanner :)

fedpre commented 11 months ago

I know! We use the old qr scanner but I want to get rid of it and use the one from the library as we use a QR code as some sort of config for the app

I wish I would be more knowledgable to help you with the orientation issue. I will try to take a look at it because you do a fantastic job at keeping up with this awesome library and I want to help

danieloprado commented 11 months ago

I've try to use version 3 with vision-camera-ocr, but when I set pixelFormat to yuv app crashe with camera error 4 on my Samsung device.

1947

2sem commented 11 months ago

I had to just cherry-pick the fix into 2.15.

edritech93 commented 11 months ago

same issue for me, iOS 17 and Xcode 15

IvanByRool commented 11 months ago

hey @mrousavy, thanks for the great work on this.

I have the same issue here, with reanimated : 3.5.4 vision camera : 3.3.1 Edit: RN : .72.5

And still getting "Frame processors are not enabled!"

Don't know if it's related, but trying to fix another issue updating, I followed your example and added "#if __has_include(<VisionCamera/FrameProcessorPlugin.h>)" on top of my FrameProcessor.m file.

Any idea ? thx Ivan

mrousavy commented 11 months ago

Hey - hm that's weird, which react-native-worklets-core version do you have? @IvanByRool

IvanByRool commented 11 months ago

Hey @mrousavy,

"react-native-worklets-core": "^0.2.2", "react-native-reanimated": "^3.5.4",

Still happening, I've tried the tuto as described here : https://react-native-vision-camera.com/docs/guides/frame-processors-plugins-ios Also tried the example (which is a little bit different) here : https://github.com/mrousavy/react-native-vision-camera/blob/main/package/example/ios/Frame%20Processor%20Plugins/Example%20Swift%20Plugin/ExampleSwiftFrameProcessor.m

Both without success. Thanks for your help, Ivan

IvanByRool commented 11 months ago

Don't know if it's a pre-requisite, but the problem solved itself after updating Xcode from 14.3 to 15. If it helps someone,

mrousavy commented 11 months ago

Awesome!

Weird issue though.

mrousavy commented 11 months ago

Can we close this then? If the Xcode 15 upgrade fixes it

rach-123 commented 11 months ago

I am also facing the same issue after upgrading to xcode 15. For some reason i cannot upgrade reanimated and vision-camera to v3. Could you please provide some solution for v2 or any help is much appreciated.

ombogdanJoinToIt commented 11 months ago

same problem with xcode 15

mrousavy commented 11 months ago

Sorry, I only provide such support for V3. In V3 everything works afaik

thongquach commented 11 months ago

Since version 2.16.0 react-native-reanimanted 3.5+ is needed for the Frame Processors to be enabled.

If I switch to the latest react-native-reanimated 3.5.4 I get this error coming from react-native-vision-camera:

  CMake Error at CMakeLists.txt:208 (find_package):
    Could not find a package configuration file provided by
    "react-native-reanimated" with any of the following names:

      react-native-reanimatedConfig.cmake
      react-native-reanimated-config.cmake

    Add the installation prefix of "react-native-reanimated" to
    CMAKE_PREFIX_PATH or set "react-native-reanimated_DIR" to a directory
    containing one of the above files.  If "react-native-reanimated" provides a
    separate development package or SDK, be sure it has been installed.

Hi @pasquale95, I encountered the exactt same error on Android. Did you manage to fix it yet?

mssoliveira commented 10 months ago

Desde a versão 2.16.0, o react-native-reanimated 3.5+ é necessário para que os processadores de quadros sejam habilitados.

Se eu mudar para o react-native-reanimated3.5.4 mais recente, recebo este erro de react-native-vision-camera:

  CMake Error at CMakeLists.txt:208 (find_package):
    Could not find a package configuration file provided by
    "react-native-reanimated" with any of the following names:

      react-native-reanimatedConfig.cmake
      react-native-reanimated-config.cmake

    Add the installation prefix of "react-native-reanimated" to
    CMAKE_PREFIX_PATH or set "react-native-reanimated_DIR" to a directory
    containing one of the above files.  If "react-native-reanimated" provides a
    separate development package or SDK, be sure it has been installed.

Oi@pasquale95, encontrei exatamente o mesmo erro no Android. Você já conseguiu consertar?

Apparently the solution will be go to v3 as I'm having the same problem but I've already tried implementing v3 and I'm running into a build problem.

akash-r-98 commented 4 months ago

system/frame-processors-unavailable: Frame Processors are not available, react-native-worklets-core is not installed!, js engine: hermes getting this error, even tough react-native-worklets-core is installed.

erickcrus commented 1 day ago

system/frame-processors-unavailable: Frame Processors are not available, react-native-worklets-core is not installed!, js engine: hermes getting this error, even tough react-native-worklets-core is installed.

same here