react-native-vision-camera: 🐛 Build 'react-native-vision-camera' failed in v0.68.2
What were you trying to do?
I get the build error in iOS, and still can’t resolve it.
- “react”: “17.0.2”
- “react-native”: “0.68.2”
- “react-native-vision-camera”: “^2.13.5”
Things I have done
I deleted my node_modules folder rm -rf package-lock.json && rm -rf yarn.lock && rm -rf node_modules rm -rf ios/Podfile.lock && rm -rf ios/Pods yarn cd ios && pod repo update && pod update && pod install
Reproduceable Code
Undefined symbols for architecture x86_64:
"typeinfo for reanimated::Scheduler", referenced from:
typeinfo for vision::VisionCameraScheduler in VisionCameraScheduler.o
"facebook::react::LongLivedObject::LongLivedObject()", referenced from:
facebook::react::CallbackWrapper::CallbackWrapper(facebook::jsi::Function&&, facebook::jsi::Runtime&, std::__1::shared_ptr<facebook::react::CallInvoker>) in JSIUtils.o
"facebook::react::LongLivedObject::~LongLivedObject()", referenced from:
facebook::react::CallbackWrapper::CallbackWrapper(facebook::jsi::Function&&, facebook::jsi::Runtime&, std::__1::shared_ptr<facebook::react::CallInvoker>) in JSIUtils.o
facebook::react::CallbackWrapper::~CallbackWrapper() in JSIUtils.o
"facebook::react::LongLivedObjectCollection::get()", referenced from:
facebook::react::CallbackWrapper::createWeak(facebook::jsi::Function&&, facebook::jsi::Runtime&, std::__1::shared_ptr<facebook::react::CallInvoker>) in JSIUtils.o
"typeinfo for facebook::react::LongLivedObject", referenced from:
typeinfo for facebook::react::CallbackWrapper in JSIUtils.o
"facebook::react::LongLivedObjectCollection::add(std::__1::shared_ptr<facebook::react::LongLivedObject>) const", referenced from:
facebook::react::CallbackWrapper::createWeak(facebook::jsi::Function&&, facebook::jsi::Runtime&, std::__1::shared_ptr<facebook::react::CallInvoker>) in JSIUtils.o
"facebook::jsi::detail::throwJSError(facebook::jsi::Runtime&, char const*)", referenced from:
std::__1::shared_ptr<facebook::jsi::HostObject> facebook::jsi::Object::asHostObject<facebook::jsi::HostObject>(facebook::jsi::Runtime&) const in JSIUtils.o
"vtable for reanimated::Scheduler", referenced from:
reanimated::Scheduler::Scheduler() in VisionCameraScheduler.o
reanimated::Scheduler::~Scheduler() in VisionCameraScheduler.o
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
"facebook::jsi::Object::getPropertyAsObject(facebook::jsi::Runtime&, char const*) const", referenced from:
___43+[JSConsoleHelper getLogFunctionForBridge:]_block_invoke_2 in JSConsoleHelper.o
"vtable for facebook::jsi::HostObject", referenced from:
facebook::jsi::HostObject::HostObject() in FrameProcessorUtils.o
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
"typeinfo for facebook::jsi::HostObject", referenced from:
typeinfo for FrameHostObject in FrameHostObject.o
convertJSIValueToObjCObject(facebook::jsi::Runtime&, facebook::jsi::Value const&, std::__1::shared_ptr<facebook::react::CallInvoker>) in JSIUtils.o
"typeinfo for facebook::jsi::JSError", referenced from:
FrameHostObject::assertIsFrameStrong(facebook::jsi::Runtime&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in FrameHostObject.o
FrameHostObject::get(facebook::jsi::Runtime&, facebook::jsi::PropNameID const&)::$_1::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long) const in FrameHostObject.o
GCC_except_table6 in FrameProcessorUtils.o
GCC_except_table3 in JSConsoleHelper.o
"facebook::jsi::HostObject::set(facebook::jsi::Runtime&, facebook::jsi::PropNameID const&, facebook::jsi::Value const&)", referenced from:
vtable for FrameHostObject in FrameHostObject.o
"facebook::jsi::HostObject::~HostObject()", referenced from:
FrameHostObject::~FrameHostObject() in FrameHostObject.o
"facebook::jsi::JSError::~JSError()", referenced from:
FrameHostObject::assertIsFrameStrong(facebook::jsi::Runtime&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in FrameHostObject.o
FrameHostObject::get(facebook::jsi::Runtime&, facebook::jsi::PropNameID const&)::$_1::operator()(facebook::jsi::Runtime&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long) const in FrameHostObject.o
"facebook::react::LongLivedObject::allowRelease()", referenced from:
facebook::react::CallbackWrapper::allowRelease() in JSIUtils.o
"facebook::jsi::JSError::JSError(facebook::jsi::Runtime&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)", referenced from:
facebook::jsi::JSError::JSError(facebook::jsi::Runtime&, char const*) in FrameHostObject.o
"facebook::react::LongLivedObjectCollection::remove(facebook::react::LongLivedObject const*) const", referenced from:
facebook::react::CallbackWrapper::allowRelease() in JSIUtils.o
"facebook::jsi::Value::Value(facebook::jsi::Value&&)", referenced from:
facebook::jsi::Value::operator=(facebook::jsi::Value&&) in JSIUtils.o
"facebook::jsi::Object::getPropertyAsFunction(facebook::jsi::Runtime&, char const*) const", referenced from:
___43+[JSConsoleHelper getLogFunctionForBridge:]_block_invoke_2 in JSConsoleHelper.o
"facebook::jsi::Value::~Value()", referenced from:
facebook::jsi::Value::Value<facebook::jsi::Function>(facebook::jsi::Function&&) in FrameHostObject.o
facebook::jsi::Value::Value<facebook::jsi::String>(facebook::jsi::String&&) in FrameHostObject.o
____Z42convertJSIFunctionToFrameProcessorCallbackRN8facebook3jsi7RuntimeERKNS0_8FunctionE_block_invoke in FrameProcessorUtils.o
facebook::jsi::Value facebook::jsi::Function::callWithThis<facebook::jsi::Object>(facebook::jsi::Runtime&, facebook::jsi::Object const&, facebook::jsi::Object&&) const in FrameProcessorUtils.o
facebook::jsi::Function::callWithThis(facebook::jsi::Runtime&, facebook::jsi::Object const&, facebook::jsi::Value const*, unsigned long) const in FrameProcessorUtils.o
facebook::jsi::Value::Value(facebook::jsi::Runtime&, facebook::jsi::Object const&) in FrameProcessorUtils.o
___43+[JSConsoleHelper getLogFunctionForBridge:]_block_invoke_2 in JSConsoleHelper.o
...
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
What happened instead?
Build failed
Relevant log output
No response
Device
iPhone 8 (iOS 14.3)
VisionCamera Version
2.13.5
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: 5
- Comments: 28 (6 by maintainers)
Guys, I managed to find a solution. When I implemented firebase into my project, it requested from me to have
use_frameworks!
in Podfile. That was the time I started getting this error. So I deleteduse_frameworks!
and addeduse_modular_headers!
.After doing this, I didn’t had any errors except some glog issue, so I had to add this in Podfile next to pods:
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec', :modular_headers => false
The app is finally working now!
@hb-webdev thanks to @bglgwyng and @mikehardy I was able to run my application with Firebae and Camera libs today. Here is my final Podfile:
Note the long condition:
Replace it with packages of your app that have issues with
use_frameworks!
Hope this helps.
Nice!
I see this block, doing the thing you mention:
Could be similar to our workaround in react-native-firebase here, though they look a little different:
It is exactly the same as the workaround (which also works) documented in react-native-permissions: https://github.com/zoontek/react-native-permissions#workaround-for-use_frameworks-issues
So…possibly could be solved in podspec here (somehow, though not aware of an elegant way yet) or could be a documentation solution similar to react-native-permissions (though there is a little issue tracker traffic related to it when people aren’t aware)…
https://github.com/bglgwyng/FirebaseExample I tried firebase + vision camera + frame processor here. It works fine. Firestore client is ok and the camera is too. @mrousavy My workaround was just setting
RNAnimated
to be built as a static library and there seems no problem for now.Sorry, I do not propose workarounds to
use_frameworks
, I work with maintainers to fixuse_frameworks
compilation in their modules Avoiding it is not (I repeat not) a viable option for any users of react-native-firebase and that’s my focusIt appears that react-native-vision-camera may not work with
use_frameworks
then, and that’s a react-native-vision-camera issue.Attempting to work around the issue by removing
use_frameworks
and addingmodular_headers
stuff is a temporary workaround at best@mrousavy have you tried building any compile-test rig for react-native-vision-camera with
use_frameworks! :linkage => :static
in the Podfile? Seems it may have some symbol location (read as: header pathing…) issue ?Worked for me also. Thanks 👍🏻
@krisidmisso, Thanks Bro, your podfile example help me to make build sucessfull, i lost any hours with this. I runned before build starts too:
src/ios $ pod clean && pod deintegrate && pod install