Closed valn1 closed 1 year ago
Hi, I had the same issue. Did you try to clear the caches of gradle (./gradlew clean) and metro (npm start -- --cache-reset)?
@valn1 ,Hi, I build in error on android; could you list the version of react-native 、react-native-reanimated、 react-native-vision-camera and vision-camera-code-scanner ? also,please tell me how you configure about react-native-reanimated. I build error :
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.
I had the same issue, but only when debugging the app. When I stop debugging and restart the app, everything works fine.
any news here?
I had the same issue, but only when debugging the app. When I stop debugging and restart the app, everything works fine.
same here. Works fine when not in debug mode
What causes the pattern to be narrow?
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)
also, 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"
however, when i tried to build the app in release, it just doesnt open, i don't know if it is because of any of those 3 libs, but i'm gonna keep digging to find out and will return with answers(hopefully)
i guess someone could try out that fix in a release build in their environment so we could see if it's something with my project idk
ahh also, my podfile:
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
platform :ios, '12.4'
install! 'cocoapods', :deterministic_uuids => false
target 'OpaSuite' do
config = use_native_modules!
# Flags change depending on the env values.
flags = get_default_flags()
use_react_native!(
:path => config[:reactNativePath],
# Hermes is now enabled by default. Disable by setting this flag to false.
# Upcoming versions of React Native may rely on get_default_flags(), but
# we make it explicit here to aid in the React Native upgrade process.
:hermes_enabled => true,
:fabric_enabled => flags[:fabric_enabled],
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable the next line.
#:flipper_configuration => FlipperConfiguration.enabled,
# An absolute path to your application root.
:app_path => "#{Pod::Config.instance.installation_root}/.."
)
permissions_path = '../node_modules/react-native-permissions/ios'
pod 'Permission-Camera', :path => "#{permissions_path}/Camera"
pod 'Firebase', :modular_headers => true
pod 'FirebaseCore', :modular_headers => true
pod 'FirebaseCoreInternal', :modular_headers => true
pod 'GoogleUtilities', :modular_headers => true
target 'OpaSuiteTests' do
inherit! :complete
# Pods for testing
end
post_install do |installer|
react_native_post_install(
installer,
# Set `mac_catalyst_enabled` to `true` in order to apply patches
# necessary for Mac Catalyst builds
:mac_catalyst_enabled => false
)
__apply_Xcode_12_5_M1_post_install_workaround(installer)
end
end
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 easier
Was facing the same error, using npx pod install definitely solved the error for me.
Edit: npx pod install results in not showing the frame processors are not enabled error at first but the error message comes when restarting the app.
Can't read qr codes with it. I have to admit, that I'm using this library recently, so this could be also an implementation error. Will create an issue for that.
I ran into this due to a library requiring use_frameworks!
and ended up using https://github.com/joncardasis/cocoapods-user-defined-build-types to get around it. I tried many of the other posted solutions, but this was the only one that worked for me
Thanks for the solution
It worked for me on both (iOS and Android) for react native 0.70.6
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 easier
Thanks for the solution
- use "react-native-vision-camera": "2.14.1"
- use the patch from version 2.14.1 of vision camera.
- use "react-native-reanimated": "2.10.0"
- use firebase 15.3.0
It worked for me on both (iOS and Android) for react native 0.70.6
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 easier
I did the same changes but did not resolve this issue. Still getting the same error. I have been working for 2 days but not able to resolve yet. Please let me know if anyone have solution. Thanks
try deleting Xcode's derived data, podfile.lock and Pods and running npx pod-install again
try deleting Xcode's derived data, podfile.lock and Pods and running npx pod-install again
Thanks for your replay I tried changing your suggestions like removed Xcode's derived data removed podfile.lock removed Pods npx pod-install
not worked.
Anyone have solution?
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
add gem 'plugin 'cocoapods-user-defined-build-types'
before the targets
remove those pre_install workarounds that the libs suggested for working with use_frameworks!
replace use_frameworks! :linkage => :static
or use_frameworks!
with enable_user_defined_build_types!
add this to your target
pod '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
podfile:
#$RNFirebaseAsStaticFramework = true ####removing this bit that the firebase lib suggested as a workaround
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
platform :ios, min_ios_version_supported
prepare_react_native_project!
# If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set.
# because `react-native-flipper` depends on (FlipperKit,...) that will be excluded
#
# To fix this you can also exclude `react-native-flipper` using a `react-native.config.js`
# ```js
# module.exports = {
# dependencies: {
# ...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}),
# ```
flipper_config = ENV['NO_FLIPPER'] == "1" ? FlipperConfiguration.disabled : FlipperConfiguration.enabled
linkage = ENV['USE_FRAMEWORKS']
if linkage != nil
Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
use_frameworks! :linkage => linkage.to_sym
end
#### add this bit to enable defined build types which allows the user to build pods individually by architecture type
plugin 'cocoapods-user-defined-build-types'
target 'yourappname' do
#pre_install do |installer|
# installer.pod_targets.each do |pod|
# if pod.name.eql?('vision-camera-code-scanner') || pod.name.eql?('VisionCamera')
# def pod.build_type
# Pod::BuildType.static_library
# end
# end
# end
# Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
# installer.pod_targets.each do |pod|
# if pod.name.eql?('RNPermissions') || pod.name.start_with?('Permission-')
# def pod.build_type;
# Pod::BuildType.static_library
# end
# end
# end
#end
####remove these pre_installer stuff, the rn-permissions and vision-camera-code-scanner suggested these workarounds, but we won't need'em anymore(not sure tho, keep'em commented)
####
#use_frameworks! :linkage => :static
#### here we change the use_frameworks! flag to this enable_user_defined_build_types! thing so we can specify we
#### want the camera stuff to be static_framework
enable_user_defined_build_types!
####
permissions_path = '../node_modules/react-native-permissions/ios'
pod 'Permission-Camera', :path => "#{permissions_path}/Camera"
pod 'Permission-Microphone', :path => "#{permissions_path}/Microphone"
pod 'Permission-PhotoLibrary', :path => "#{permissions_path}/PhotoLibrary"
pod 'Permission-LocationAlways', :path => "#{permissions_path}/LocationAlways"
config = use_native_modules!
# Flags change depending on the env values.
flags = get_default_flags()
use_react_native!(
:path => config[:reactNativePath],
# Hermes is now enabled by default. Disable by setting this flag to false.
# Upcoming versions of React Native may rely on get_default_flags(), but
# we make it explicit here to aid in the React Native upgrade process.
:hermes_enabled => flags[:hermes_enabled],
:fabric_enabled => flags[:fabric_enabled],
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable the next line.
#:flipper_configuration => flipper_config,
#### I'm not using flipper here, but i imagine you can use it now as we are not using use_frameworks anymore
# An absolute path to your application root.
:app_path => "#{Pod::Config.instance.installation_root}/.."
)
#### the firebase and google stuff is a workaround that firebase suggested, i'm keeping it for mental health reasons, but
#### if you feel brave, go ahead and remove it
pod 'Firebase', :modular_headers => true
pod 'FirebaseCore', :modular_headers => true
pod 'FirebaseCoreInternal', :modular_headers => true
pod 'GoogleUtilities', :modular_headers => true
#### add these 3 guys bellow so the MLKit pods are installed as static_frameworks
pod 'MLKitBarcodeScanning', :build_type => :static_framework
pod 'MLKitCommon', :build_type => :static_framework
pod 'MLKitVision', :build_type => :static_framework
post_install do |installer|
react_native_post_install(
installer,
# Set `mac_catalyst_enabled` to `true` in order to apply patches
# necessary for Mac Catalyst builds
:mac_catalyst_enabled => false
)
__apply_Xcode_12_5_M1_post_install_workaround(installer)
end
end
`
gemfile:
`source 'https://rubygems.org'
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby File.read(File.join(__dir__, '.ruby-version')).strip
gem 'cocoapods', '~> 1.11', '>= 1.11.3'
gem 'cocoapods-user-defined-build-types'
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
Any update? I have same issue on android release package
podfile:
#$RNFirebaseAsStaticFramework = true ####removing this bit that the firebase lib suggested as a workaround require_relative '../node_modules/react-native/scripts/react_native_pods' require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' platform :ios, min_ios_version_supported prepare_react_native_project! # If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set. # because `react-native-flipper` depends on (FlipperKit,...) that will be excluded # # To fix this you can also exclude `react-native-flipper` using a `react-native.config.js` # ```js # module.exports = { # dependencies: { # ...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}), # ``` flipper_config = ENV['NO_FLIPPER'] == "1" ? FlipperConfiguration.disabled : FlipperConfiguration.enabled linkage = ENV['USE_FRAMEWORKS'] if linkage != nil Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green use_frameworks! :linkage => linkage.to_sym end #### add this bit to enable defined build types which allows the user to build pods individually by architecture type plugin 'cocoapods-user-defined-build-types' target 'yourappname' do #pre_install do |installer| # installer.pod_targets.each do |pod| # if pod.name.eql?('vision-camera-code-scanner') || pod.name.eql?('VisionCamera') # def pod.build_type # Pod::BuildType.static_library # end # end # end # Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {} # installer.pod_targets.each do |pod| # if pod.name.eql?('RNPermissions') || pod.name.start_with?('Permission-') # def pod.build_type; # Pod::BuildType.static_library # end # end # end #end ####remove these pre_installer stuff, the rn-permissions and vision-camera-code-scanner suggested these workarounds, but we won't need'em anymore(not sure tho, keep'em commented) #### #use_frameworks! :linkage => :static #### here we change the use_frameworks! flag to this enable_user_defined_build_types! thing so we can specify we #### want the camera stuff to be static_framework enable_user_defined_build_types! #### permissions_path = '../node_modules/react-native-permissions/ios' pod 'Permission-Camera', :path => "#{permissions_path}/Camera" pod 'Permission-Microphone', :path => "#{permissions_path}/Microphone" pod 'Permission-PhotoLibrary', :path => "#{permissions_path}/PhotoLibrary" pod 'Permission-LocationAlways', :path => "#{permissions_path}/LocationAlways" config = use_native_modules! # Flags change depending on the env values. flags = get_default_flags() use_react_native!( :path => config[:reactNativePath], # Hermes is now enabled by default. Disable by setting this flag to false. # Upcoming versions of React Native may rely on get_default_flags(), but # we make it explicit here to aid in the React Native upgrade process. :hermes_enabled => flags[:hermes_enabled], :fabric_enabled => flags[:fabric_enabled], # Enables Flipper. # # Note that if you have use_frameworks! enabled, Flipper will not work and # you should disable the next line. #:flipper_configuration => flipper_config, #### I'm not using flipper here, but i imagine you can use it now as we are not using use_frameworks anymore # An absolute path to your application root. :app_path => "#{Pod::Config.instance.installation_root}/.." ) #### the firebase and google stuff is a workaround that firebase suggested, i'm keeping it for mental health reasons, but #### if you feel brave, go ahead and remove it pod 'Firebase', :modular_headers => true pod 'FirebaseCore', :modular_headers => true pod 'FirebaseCoreInternal', :modular_headers => true pod 'GoogleUtilities', :modular_headers => true #### add these 3 guys bellow so the MLKit pods are installed as static_frameworks pod 'MLKitBarcodeScanning', :build_type => :static_framework pod 'MLKitCommon', :build_type => :static_framework pod 'MLKitVision', :build_type => :static_framework post_install do |installer| react_native_post_install( installer, # Set `mac_catalyst_enabled` to `true` in order to apply patches # necessary for Mac Catalyst builds :mac_catalyst_enabled => false ) __apply_Xcode_12_5_M1_post_install_workaround(installer) end end ` gemfile: `source 'https://rubygems.org' # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version ruby File.read(File.join(__dir__, '.ruby-version')).strip gem 'cocoapods', '~> 1.11', '>= 1.11.3' gem 'cocoapods-user-defined-build-types'
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
This seems to have fixed the issue for me; thanks!
@valn1 much thank you!!!! your a rock star.
I followed all the instruction. added the different versions. patched the package, plus had to make extra patches where i had to make sure that CLANG_CXX_LANGUAGE_STANDARD used the same version. also had to make this change in babel.config.js
[
'react-native-reanimated/plugin',
{
globals: ['__scanCodes'],
},
],
and then lastely and this is probably the step that most people forget or dont even know about, you have to reset your cache.
react-native start --reset-cache
npm start -- --reset-cache
expo start -c
yarn cache clean
yarn start --reset-cache
hope this helps 😉
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
pre_install do |installer|
installer.pod_targets.each do |pod|
if pod.name.eql?('RNReanimated') || pod.name.eql?('VisionCamera')
def pod.build_type
Pod::BuildType.static_library
end
end
end
end
the issue seems solved.
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
pre_install do |installer| installer.pod_targets.each do |pod| if pod.name.eql?('RNReanimated') || pod.name.eql?('VisionCamera') def pod.build_type Pod::BuildType.static_library end end end end
the issue seems solved.
@umbertoghio yes, your answer solves the problem most of the time, but some cases like mine required a little bit more work to get working. This is because the pods i use dont work well together, in my case, the problematic ones were firebase, vision-camera and reanimated. they work differently from each other and need "special treatment". For that reason, the only way i could make it work in my case was to declare each pod with its own build type
that said, i'm closing this issue as there isn't any new questions about it
I've the same error it doesn't work for me in Android & iOs
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.
isionCamera V3 now includes a QR/Barcode Scanner!
but it ot working
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
cd ios/
pod cache clean --all
pod deintegrate
pod install
Additional Cleanup: For a thorough cleanup, consider these steps:
watchman watch-del-all
rm -rf node_modules/ && npm install
rm -rf /tmp/metro-*.lock
🧩 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!
Again, I recommend everyone to upgrade to VisionCamera V3 if they can. I no longer support V2, V3 is the way to go.
What blocks you from upgrading to V3?
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.
Thanks @tomyrodeghiero, appreciate it! ❤️
Again, I recommend everyone to upgrade to VisionCamera V3 if they can. I no longer support V2, V3 is the way to go.
What blocks you from upgrading to V3?
SDK 26, I want my app support SDK 21 min :(
any update??
Again, I recommend everyone to upgrade to VisionCamera V3 if they can. I no longer support V2, V3 is the way to go. What blocks you from upgrading to V3?
SDK 26, I want my app support SDK 21 min :(
i have the same issue.. i need sdk still in 22 and i cant find any lib works fine with that.. have you found some alternative, @nth-zik?
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
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