🐛 frame-processor/unavailable: Frame Processors are not enabled
What were you trying to do?
Using this + the QR scanner library for QR detection.
Reproduceable Code
import { observer } from 'mobx-react-lite'
import * as React from 'react'
import 'react-native-reanimated'
import { StyleSheet, View } from 'react-native'
import { useCameraDevices, Camera } from 'react-native-vision-camera'
import { useScanBarcodes, BarcodeFormat } from 'vision-camera-qrcode-scanner'
import { Center, Flex, Heading, Text } from 'native-base'
import { useIsFocused } from '@react-navigation/core'
import Layout from '../../components/layouts/Layout'
export const ScanScreen: React.FC = observer(({ navigation }) => {
const [hasPermission, setHasPermission] = React.useState(false)
const devices = useCameraDevices()
const device = devices.back
const isFocused = useIsFocused()
const [frameProcessor, qrCodes] = useScanBarcodes([BarcodeFormat.ALL_FORMATS])
const [isActive, setIsActive] = React.useState(isFocused)
React.useEffect(() => {
; (async () => {
const status = await Camera.requestCameraPermission()
setHasPermission(status === 'authorized')
})()
}, [])
React.useEffect(() => {
if (qrCodes.length) {
console.log(qrCodes[0])
navigation.navigate('details', { id: qrCodes[0].displayValue })
}
}, [qrCodes.length])
return (
<Layout noScroll noPadding>
<View style={styles.overlayContent}>
<Center pb={16}>
{qrCodes.map((qrCode, idx) => (
<Text key={idx} style={styles.qrCodeTextURL}>
{qrCode.displayValue}
</Text>
))}
</Center>
</View>
{device != null && hasPermission && (
<Camera
style={StyleSheet.absoluteFill}
device={device}
isActive={isFocused}
frameProcessor={isFocused ? frameProcessor : undefined}
frameProcessorFps={1}
/>
)}
</Layout>
)
})
What happened instead?
frame-processor/unavailable: Frame Processors are not enabled.
The app works perfectly after a completely clean start - and after code changes (or bundle refresh) I can't use the frameProcessors function at all.
I'm just guessing here - I disabled the assertFrameProcessorsEnabled call in node_modules/react-native-vision-camera/src/Camera.tsx and I get the error:
Invariant Violation: Tried to register two views with the same name CameraView, js engine: hermes
So, I can only guess (a proper guess) that this library perhaps is not tearing down views correctly, so next run they are not initialised correctly?
I've managed to find a temporary fix (it stopped working after a while) by making the following change:
- {device != null && hasPermission && (
+ {device != null && hasPermission && isFocused && (
Relevant log output
No response
Device
OnePlus 7 Pro (Android 12)
VisionCamera Version
2.9.4
Additional information
- [ ] I am using Expo
- [X] I have read the Troubleshooting Guide
- [X] I agree to follow this project's Code of Conduct
- [X] I searched for similar issues in this repository and found none.
Interesting, does this work on iOS?
My colleagues on iOS tell me they haven't experienced the issue, but ill update this thread if they do today.
@mrousavy this also happens with me after navigating to the screen app crashes with this error, after restarting the app it works fine
this is the error `com.facebook.react.common.c: frame-processor/unavailable: Frame Processors are not enabled. See https://mrousavy.github.io/react-native-vision-camera/docs/guides/troubleshooting, js engine: hermes, stack: Wrapper@1:169960 _createSuperInternal@1:1606048 CameraError@1:1606491 _createSuperInternal@1:1606048 CameraRuntimeError@1:1606880 assertFrameProcessorsEnabled@1:1603699 setFrameProcessor@1:1603717 onViewReady@1:1603837 invokeGuardedCallbackImpl@1:106347 invokeGuardedCallback@1:106404 invokeGuardedCallbackAndCatchFirstError@1:106436 executeDispatch@1:106568 executeDispatchesAndReleaseTopLevel@1:109957 forEachAccumulated@1:108051 anonymous@1:110314 batchedUpdatesImpl@1:166405 batchedUpdates@1:109874 _receiveRootNodeIDEvent@1:110151 receiveEvent@1:160446 __callFunction@1:93774 anonymous@1:92263 __guard@1:93220 callFunctionReturnFlushedQueue@1:92221
at com.facebook.react.modules.core.ExceptionsManagerModule.reportException(ExceptionsManagerModule.java:12)
at java.lang.reflect.Method.invoke(Method.java)
at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:18)
at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:13)
at com.facebook.react.bridge.queue.NativeRunnable.run(NativeRunnable.java)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:1)
at android.os.Looper.loop(Looper.java:236)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:8)
at java.lang.Thread.run(Thread.java:923)`
Are you sure that you're not using some remote debugger such as Chrome? It makes me wonder that the JSI functions are missing. Or maybe you are using fast-refresh and that breaks?
Can you reproduce the error if you simply open the app on your phone, without any debugger attached, and navigate through screens without fast-refresh or hot-reload?
Not using Chrome debugger - doesn't work with [insert package that I forget now] so I've been using flipper when required, but this occurs if flipper is connected or not.
Disabling fast refresh did not fix the issue if it already occurs. Tried this too:
- From a fresh app (
react-native run-android) on device - Disabling fast refresh (no option for hot-reload)
- Clean bundle
yarn install && yarn start --reset-cache - Navigate to page with camera, allow permission
- Works fine
- Navigate away from page
- Error
Exception in HostFunction: com.mrousavy.camera.ViewNotFoundError: [system/view-not-found] The given view (ID 2559) was not found in the view manager. - Reload app via metro bundler
- Navigate back to camera screen ->
frame processors are not enabled
Hope this helps somewhat!
Ah, this is a race condition in the C++ view finder part. (findViewById, called on JS Thread through JNI, so C++ -> JS -> C++)
I have tried several times to fix this issue, but all of those times turned into long nights of debugging and after the morning light started to shine through my window I didn't want to spend more time on it. If you are interested in posting a bug bounty on the issue, let me know and me and my guys in my agency can look at this issue in greater detail to fix it once and for all.
No worries. If you don't mind linking any relevant code, I will see if I can't obtain time myself to see what I can do.
Appreciate it all the same!
Facing the same issue, by when this PR will be merged?
Please see if #691 fixes the issue for you guys 🙏
@mrousavy almost!
I no longer experience the original issue on reload, however navigating away from the screen that uses frame processors gives me
com.mrousavy.camera.ViewNotfoundError: [system/view-not-found] The given view (ID 12429) was not found in the view manager
I tried nuking node_modules & gradlew clean and no change.
Hm, okay that's a separate concurrency issue. will take a look soon
@mrousavy im using ubuntu, just installing the package and did changes in android manifest and other files given in docs.
VisionCamera: Frame Processors are disabled because REA v2 does not exist. C++ part will not be built.
> Task :app:checkDebugAarMetadata FAILED
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings
9 actionable tasks: 2 executed, 7 up-to-date
FAILURE: Build failed with an exception.
for Android It won't work at all. To reproduce the issue just create one app and install the package. that's all, one will get this error.
that's all, one will get this error.
@vikasacharya16 the output you shared is not an error.
Please read up on what errors are and how to identify them, this is a simple log output. The actual error is further up.
@jack828 Hey! Does v2.13.1 fix the issue for you?
hey @mrousavy sorry for the delay. I've just upgraded the package in our project and it looks like the issue is completely resolved. I can interact with the camera as required with no issues.
Thanks so much!!
I re-built and re-ran the app while also restarting metro with --reset-cache and that seemed to fix my issue. I also ran npm update but it didn't appear to update much in package.json, just some deps of deps.
I'm getting this same error running in debug on Android emulator...

- "react-native-vision-camera": "2.15.2",
- "react-native-reanimated": "2.13.0",
- "vision-camera-code-scanner": "0.2.0",
- "react-native": "0.68.2",
- "react": "17.0.2",
import 'react-native-reanimated'
import React, { useEffect, useState } from 'react'
import { View, Alert, StyleSheet } from 'react-native'
import styles from './styles'
import { Camera, useCameraDevices, useFrameProcessor } from 'react-native-vision-camera'
import { BarcodeFormat, scanBarcodes, Barcode } from 'vision-camera-code-scanner'
import { runOnJS } from 'react-native-reanimated'
const QRReader: React.FC = () => {
const [loading, setLoading] = useState<boolean>(false)
const devices = useCameraDevices()
const device = devices.back
const [hasPermission, setHasPermission] = useState<boolean>(false)
const [barcodes, setBarcodes] = useState<Barcode[]>()
const frameProcessor = useFrameProcessor((frame) => {
'worklet'
const detectedBarcodes = scanBarcodes(frame, [BarcodeFormat.QR_CODE], { checkInverted: true })
runOnJS(setBarcodes)(detectedBarcodes)
}, [])
useEffect(() => {
;(async () => {
const status = await Camera.requestCameraPermission()
setHasPermission(status === 'authorized')
})()
}, [])
useEffect(() => {
if (barcodes && barcodes.length) {
console.log('barcodes', barcodes);
}
}, [barcodes])
return (
<View style={styles.container}>
{device != null && hasPermission && (
<>
<Camera
style={StyleSheet.absoluteFill}
isActive={true}
device={device}
frameProcessor={frameProcessor}
frameProcessorFps={1}
/>
</>
)}
</View>
)
}
export default QRReader
I'm getting this same error running in debug on Android emulator...
- "react-native-vision-camera": "2.15.2",
- "react-native-reanimated": "2.13.0",
- "vision-camera-code-scanner": "0.2.0",
- "react-native": "0.68.2",
- "react": "17.0.2",
import 'react-native-reanimated' import React, { useEffect, useState } from 'react' import { View, Alert, StyleSheet } from 'react-native' import styles from './styles' import { Camera, useCameraDevices, useFrameProcessor } from 'react-native-vision-camera' import { BarcodeFormat, scanBarcodes, Barcode } from 'vision-camera-code-scanner' import { runOnJS } from 'react-native-reanimated' const QRReader: React.FC = () => { const [loading, setLoading] = useState<boolean>(false) const devices = useCameraDevices() const device = devices.back const [hasPermission, setHasPermission] = useState<boolean>(false) const [barcodes, setBarcodes] = useState<Barcode[]>() const frameProcessor = useFrameProcessor((frame) => { 'worklet' const detectedBarcodes = scanBarcodes(frame, [BarcodeFormat.QR_CODE], { checkInverted: true }) runOnJS(setBarcodes)(detectedBarcodes) }, []) useEffect(() => { ;(async () => { const status = await Camera.requestCameraPermission() setHasPermission(status === 'authorized') })() }, []) useEffect(() => { if (barcodes && barcodes.length) { console.log('barcodes', barcodes); } }, [barcodes]) return ( <View style={styles.container}> {device != null && hasPermission && ( <> <Camera style={StyleSheet.absoluteFill} isActive={true} device={device} frameProcessor={frameProcessor} frameProcessorFps={1} /> </> )} </View> ) } export default QRReader
After upgrade to "react-native": "0.70.6", the problem is still happening...
I can't get away from this "frame-processor/unavailable: Frame Processors are not enabled" error.
While building, it seems to log that "frame processors are enabled!"

So I'm not sure why it is throwing this error. I cannot use the "frameProcessor" prop on Camera.
Finally, I resolved this by upgrading my emulator SDK version to 31.
Hey @emaxedon I am facing same issue on the development build on my device (One Plus 9r). Surprisingly its working on my emulator . How do i solve this problem? PS - I am relatively new to react-native
My camerascreen code - `import { Button, StyleSheet, Text, View ,TouchableOpacity} from "react-native"; import { StatusBar } from "expo-status-bar"; import * as MediaLibrary from "expo-media-library"; import * as Permissions from "expo-permissions"; import { useRef, useState, useEffect } from "react"; import styles from "../styles"; import { Ionicons } from "@expo/vector-icons"; import { useIsFocused } from "@react-navigation/native"; import {useCameraDevices,Camera,CameraPermissionStatus,frameRateIncluded,useFrameProcessor} from 'react-native-vision-camera'; import { examplePlugin } from './frame-Processors/ExamplePlugin'; import {useFrameCallback} from 'react-native-reanimated';
export default function CameraScreen({ navigation }) {
const [cameraDevice, setCameraDevice] = useState('back');
const [recording, setRecording] = useState(false);
const [flash, setFlash] = useState('off');
const [cameraPermission, setCameraPermission] = useState
const cameraRef = useRef
var device = devices[cameraDevice];
const frameProcessor = useFrameProcessor((frame) => {
'worklet';
const values = examplePlugin(frame);
console.log(Return Values: ${JSON.stringify(values)});
}, []);
useEffect(() => { Camera.getCameraPermissionStatus().then(setCameraPermission); Camera.getMicrophonePermissionStatus().then(setMicrophonePermission); if (cameraPermission!='authorized'){ Camera.requestCameraPermission().then(setCameraPermission); } if (microphonePermission!='authorized'){ Camera.requestMicrophonePermission().then(setMicrophonePermission); } }, [setCameraPermission,setMicrophonePermission]);
console.log(Re-rendering Navigator. Camera: ${cameraPermission} | Microphone: ${microphonePermission});
if (!device) { return null; }
async function toggleCameraType(){ await setCameraDevice(cameraDevice => (cameraDevice=='back'?'front':'back')) device = devices[cameraDevice]; }
function startRecording(){ try { if (cameraRef.current == null) throw new Error('Camera ref is null!');
console.log('calling startRecording()...');
cameraRef.current.startRecording({
flash: flash,
onRecordingError: (error) => {
console.error('Recording failed!', error);
stopRecording();
},
onRecordingFinished: (video) => {
console.log(`Recording successfully finished! ${video.path}`);
navigation.navigate('ReelPreview',{videoURI:video.path});
stopRecording();
},
});
// TODO: wait until startRecording returns to actually find out if the recording has successfully started
console.log('called startRecording()!');
setRecording(true);
} catch (e) {
console.error('failed to start recording!', e);
}
// alert('Starting Recording')
// console.log("Lets Record")
// cameraRef.current?.startRecording({
// flash: 'on',
// onRecoringFinished: (video) => {alert(video);console.log(video)},
// onRecordingError: (error) => {alert(error);console.log(error)}
// })
} async function stopRecording (){ console.log('Recording Stopped!') await cameraRef.current?.stopRecording() } function manageFlash(){ if(!device.hasFlash){ alert('Camera does not has flash'); } console.log(flash) setFlash(flash => (flash==='on'?flash='off':flash='on')) }
return (
/>
<View style={{ flex: 9 }} />
<View
style={{
flex: 1,
justifyContent: "space-around",
alignItems: "center",
backgroundColor: "#1c1c1c",
flexDirection: 'row'
}}
>
<Ionicons
name={recording ? "stop-circle" : "play-circle"}
size={60}
color={recording ? "red" : "white"}
onPress={async () => {
console.log("btn clicked");
if (!recording) {
startRecording();
setRecording(true);
} else {
setRecording(false);
stopRecording();
}
}}
/>
<Ionicons
name={"camera-reverse"}
size={60}
color ={"white"}
onPress={toggleCameraType}
/>
<Ionicons
name={"flash"}
size={50}
color ={(device.hasFlash && flash == 'on')?"yellow":"white"}
onPress={manageFlash}
/>
</View>
{/* )} */}
</View>
); } `
Example plugin -
`/* global __example_plugin __example_plugin_swift */ import type { Frame } from 'react-native-vision-camera';
declare let _WORKLET: true | undefined;
export function examplePluginSwift(frame: Frame): string[] { 'worklet'; if (!_WORKLET) throw new Error('examplePluginSwift must be called from a frame processor!');
// @ts-expect-error because this function is dynamically injected by VisionCamera return __example_plugin_swift(frame, 'hello!', 'parameter2', true, 42, { test: 0, second: 'test' }, ['another test', 5]); }
export function examplePlugin(frame: Frame): string[] { 'worklet'; if (!_WORKLET) throw new Error('examplePlugin must be called from a frame processor!');
// @ts-expect-error because this function is dynamically injected by VisionCamera return __example_plugin(frame, 'hello!', 'parameter2', true, 42, { test: 0, second: 'test' }, ['another test', 5]); }`
Bable.config.json -
module.exports = function(api) {
api.cache(true);
return {
presets: ['babel-preset-expo'],
plugins: [
[
'react-native-reanimated/plugin',
{
globals: ['__example_plugin', '__example_plugin_swift'],
},
]
]
};
};
Error that i get on console is
ERROR frame-processor/unavailable: Frame Processors are not enabled. See https://mrousavy.github.io/react-native-vision-camera/docs/guides/troubleshooting ERROR Your app just crashed. See the error below. java.lang.UnsatisfiedLinkError: No implementation found for void com.mrousavy.camera.CameraView.frameProcessorCallback(androidx.camera.core.ImageProxy) (tried Java_com_mrousavy_camera_CameraView_frameProcessorCallback and Java_com_mrousavy_camera_CameraView_frameProcessorCallback__Landroidx_camera_core_ImageProxy_2) com.mrousavy.camera.CameraView.frameProcessorCallback(Native Method) com.mrousavy.camera.CameraView.configureSession$lambda-7$lambda-6(CameraView.kt:491) com.mrousavy.camera.CameraView.$r8$lambda$cqtIchEZdTZaV3R0UUrDpVbB1Es(Unknown Source:0) com.mrousavy.camera.CameraView$$ExternalSyntheticLambda1.analyze(Unknown Source:2) androidx.camera.core.ImageAnalysis.lambda$setAnalyzer$2(ImageAnalysis.java:463) androidx.camera.core.ImageAnalysis$$ExternalSyntheticLambda0.analyze(Unknown Source:2) androidx.camera.core.ImageAnalysisAbstractAnalyzer.lambda$analyzeImage$0$androidx-camera-core-ImageAnalysisAbstractAnalyzer(ImageAnalysisAbstractAnalyzer.java:283) androidx.camera.core.ImageAnalysisAbstractAnalyzer$$ExternalSyntheticLambda1.run(Unknown Source:14) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) java.lang.Thread.run(Thread.java:923)