Open phazei opened 2 months ago
Guten Tag, Hans here! 🍻 It seems like you are having trouble with react-native-worklets-core
while trying to build. Make sure your CocoaPods are up-to-date by running pod repo update
or pod install --repo-update
. Also, confirm that you have correctly added react-native-worklets-core
in your Podfile.
Your issue is valid, but to really help mrousavy and get this sorted, could you please try building the VisionCamera Example app? It might provide more insights, and posting more detailed logs would be great too. Feel free to check out the Troubleshooting Guide for more tips!
Lastly, if you appreciate the work being done here, consider sponsoring the project here.
Note: If you think I made a mistake, please ping
@mrousavy
to take a look.
We do not use or need Frame Processors, so we don't want them enabled, but it seems to be thinking it's finding it and enabling it, then failing because it's not there.
pod install --repo-update
didn't help
I also did a search for issues but since frame processors and the worklet are part of every single issues template, it makes it impossible to search for :(
I debugged it and discovered the issue. It's a bug in the Ruby because depending on how it's run, sometimes it returns "undefined" but other times it returns undefined
which is not the string as well as multiple lines.
I modified the podspec like so:
def Pod::getWorkletsLibraryPath
installation_root = Pod::Config.instance.installation_root.to_s
Pod::UI.puts "[VisionCamera Debug] Installation root: #{installation_root}"
command = "cd \"#{installation_root}\" && node --print \"try { console.log(require.resolve('react-native-worklets-core/package.json')) } catch(e) { console.log('PACKAGE_NOT_FOUND') }\""
Pod::UI.puts "[VisionCamera Debug] Executing command: #{command}"
output = `#{command}`
Pod::UI.puts "[VisionCamera Debug] Command output: #{output}"
Pod::UI.puts "[VisionCamera Debug] Output lines: #{output.strip.lines.map(&:inspect).join(', ')}"
if output.lines.any? { |line| line.strip == 'PACKAGE_NOT_FOUND' }
Pod::UI.puts "[VisionCamera Debug] Package not found"
return nil
elsif output.lines.any? { |line| line.include?('node_modules/react-native-worklets-core/package.json') }
path = output.lines.find { |line| line.include?('node_modules/react-native-worklets-core/package.json') }.strip
Pod::UI.puts "[VisionCamera Debug] Package found at: #{path}"
return File.dirname(path)
else
Pod::UI.puts "[VisionCamera Debug] Unexpected output, assuming package not found"
return nil
end
end
It outputs:
[VisionCamera] Thank you for using VisionCamera ❤️
[VisionCamera] If you enjoy using VisionCamera, please consider sponsoring this project: https://github.com/sponsors/mrousavy
[VisionCamera] $VCEnableLocation is not set, enabling CLLocation APIs by default...
[VisionCamera] $VCEnableFrameProcessors is not set, enabling Frame Processors if Worklets is installed...
[VisionCamera Debug] Installation root: /Users/username/Projects/frontend-nx/apps/rn/ios
[VisionCamera Debug] Executing command: cd "/Users/username/Projects/frontend-nx/apps/rn/ios" && node --print "try { console.log(require.resolve('react-native-worklets-core/package.json')) } catch(e) { console.log('PACKAGE_NOT_FOUND') }"
[VisionCamera Debug] Command output: PACKAGE_NOT_FOUND
undefined
[VisionCamera Debug] Output lines: "PACKAGE_NOT_FOUND\n", "\e[90mundefined\e[39m"
[VisionCamera Debug] Package not found
[VisionCamera] react-native-worklets-core not found - Frame Processors are disabled!
The bug in the original code is "output.strip" doesn't actually work properly in all cases when it outputs multiple lines which can happen. I tried it without outputting text, but it was inconsistent.
I have been experiencing the same issue. Upgrading to version 4.6.1 addressed the issue for me.
How were you trying to build the app?
pod install
Full build logs
Project dependencies
This is a huge 300 item list, but we're using RN 0.74.5
VisionCamera Version
4.5.3
Target platforms
iOS
Operating system
MacOS
Can you build the VisionCamera Example app?
I didn't try (⚠️ your issue might get ignored & closed if you don't try this)
Additional information