react-native-vision-camera: frame-processor/unavailable: Frame Processors are not enabledš
What were you trying to do?
i upgraded my react-native to 70 and had to start using rn vision camera for my qrcode scanner, went through all the pain of figuring out how to reanimated and qrcode in both platforms, and got it working on android, but on ios it throw that error
i read the guide and tried everything but to no success
Reproduceable Code
import React from 'react';
import {
View,
Text,
StatusBar,
ActivityIndicator
} from 'react-native';
import SimpleToast from 'react-native-simple-toast'
import STYLES from './Style/Style';
import StorageHelper from '../../Helpers/StorageHelper';
import {useCameraDevices, Camera} from 'react-native-vision-camera';
import {useScanBarcodes, BarcodeFormat} from 'vision-camera-code-scanner';
function Scanner() {
const camera = useCameraDevices();
const [frameProcessor, barcodes] = useScanBarcodes([BarcodeFormat.QR_CODE], {
checkInverted: true,
});
const onSuccess = (qrcode) => {
let url = qrcode.split('/').slice(0, -1).join('/').replace(/^(https?:\/\/)/, '');
new StorageHelper().setItem('server', {url}).then(() => {
global.navigation.replace('Webview');
});
};
React.useEffect(() => {
if (barcodes.length) {
let results = []
barcodes.forEach(code => {
if (!results.includes(code.displayValue)) {
results.push(code.displayValue)
}
})
if (results.length === 1) {
onSuccess(results[0]);
} else {
SimpleToast.show('mĆŗltiplos QRCodes', 500)
}
}
}, [barcodes])
if (!camera.back) {
return <View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
<ActivityIndicator size={50} color={'#ef7d00'}/>
</View>
}
return (
<View style={{backgroundColor: '#ef7d00', flex: 1}}>
<StatusBar barStyle="light-content" backgroundColor="#ef7d00"/>
<Camera
device={camera.back}
isActive={true}
audio={false}
frameProcessor={frameProcessor}
frameProcessorFps={1}
style={STYLES.container}>
</Camera>
<View style={{position: 'absolute', top: 0, bottom: 0, left: 0, right: 0}}>
<View style={STYLES.header}>
<Text style={STYLES.textStyle}>
No sistema IXC Soft, clique com o botão direito do mouse em qualquer lugar e clique "<Text
style={STYLES.bold}>Integração mobile</Text>".
Em seguida, encaixe o<Text style={STYLES.bold}> QRCode </Text>que dentro do
quadrado desenhado abaixo
</Text>
</View>
<View style={STYLES.filler}/>
<View style={STYLES.square}>
<View style={STYLES.outline}/>
</View>
<View style={STYLES.filler}/>
</View>
</View>
);
}
export default Scanner;
What happened instead?
the screen opens as expected, but as soon as the camera starts, i get the error ERROR frame-processor/unavailable: Frame Processors are not enabled. See https://mrousavy.github.io/react-native-vision-camera/docs/guides/troubleshooting
in debug mode it throws that error, in release mode it just crashes
Relevant log output
No response
Device
iphone 7 ios 15.7
VisionCamera Version
i tried 2.14.1 and github:mrousavy/react-native-vision-camera#b7bb8e4 in the package.json
Additional information
- I am using Expo
- I have read the Troubleshooting Guide
- I agree to follow this projectās Code of Conduct
- I searched for similar issues in this repository and found none.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 13
- Comments: 35 (3 by maintainers)
i downgraded my firebase stuff to 15.3.0 in order to not need use_frameworks
also also, always use
npx pod-install
on root folder instead of pod install on ios folder makes life easieralso, to make it work i had to keep the versions at exactly:
"react-native-reanimated": "2.10.0", "react-native-vision-camera": "2.14.1", "vision-camera-code-scanner": "0.2.0"
podfile:
disclaimer: i use FCM stuff and vision camera for scanner and obviusly reanimated, so if you use some other libs, you might have to make your own changes, but iām sure you will figure it out
ohh, hello sorry in advance for the late reply, i had forgotten i made this issue
I managed to solve it
i had to use a patch i found somewhere, itās for version 2.14.1 (ps. change the .txt to .patch before using)
react-native-vision-camera+2.14.1.txt
Hi, stumbled here while having an issue with " Frame Processors are not enabled" on iOS, this seems to be related to the ads library Iām using that requires me to add āuse_frameworks! :linkage => :staticā in my pod file, so after adding right after it
the issue seems solved.
This seems to have fixed the issue for me; thanks!
i decided to upgrade my react-native version again(did not learn from my mistakes) and ended up getting the same error as before, but this time i got it working fine
here is what i did:
first upgrade your react native version to the latest following the upgrade helper
second follow all the instructions on the vision-camera troubleshooting
third *add
gem 'cocoapods-user-defined-build-types'
to your gemfile on your podfile: *remove this$RNFirebaseAsStaticFramework = true
if you have it *addgem 'plugin 'cocoapods-user-defined-build-types'
before the targets *remove those pre_install workarounds that the libs suggested for working with use_frameworks! *replaceuse_frameworks! :linkage => :static
oruse_frameworks!
withenable_user_defined_build_types!
*add this to your targetpod 'MLKitBarcodeScanning', :build_type => :static_framework pod 'MLKitCommon', :build_type => :static_framework pod 'MLKitVision', :build_type => :static_framework
finally clear your scode derived data, pods, podfile.lock, node_modules⦠everything and reinstall all again.
this should work and if my instructions are too hard to understand, iām adding my podfile and gemfile to the next comment
disclaimer: the whole ācocoapods-user-defined-build-typesā thing changes the way you use your pods, so in case you have other pods that require the use_frameworks! flag, you might have to declare them like iāve done to the MLKit stuff good luck and i hope to never have to do this again
Hi!
Iāve spent several hours working to resolve this issue with the react-native-vision-camera package š·. Iād like to share the potential solution Iāve found. Hereās a step-by-step guide:
react-native-vision-camera: 2.15.2 react-native-reanimated: 2.17.0 vision-camera-code-scanner: 0.2.0 react-dom: ^18.2.0 react-native: 0.70.6
cd android && ./gradlew clean
yarn cache clean && yarn run android
rm -rf ios/build
Additional Cleanup: For a thorough cleanup, consider these steps:
š§© Frame Processors are now enabled with these changes!
As a guiding note for future endeavors, for those starting new projects, I highly recommend using react-native-vision-camera version 3. This updated version offers enhanced features, better stability, and consistent support.
Furthermore, a special shoutout to mrousavy is essential. The development and enhancement of react-native-vision-camera have been monumental for the React Native community. Thank you, mrousavy, for your dedication and for arming developers with such invaluable tools.
Greetings!
Hey!
JFYI; VisionCamera V3 now includes a QR/Barcode Scanner! š Check out the CodeScanner Documentation š
Try upgrading to V3 if you can, it has a much more stable yet flexible foundation.
If you appreciate me dedicating my free time to improving VisionCamera and implementing features like the Code Scanner, please consider sponsoring me on GitHub š to show your support.
Thanks for the solution
It worked for me on both (iOS and Android) for react native 0.70.6
My errors are different than yours, but with RN 0.7, I canāt seem to get ML kit frame processors to work in IOS.