'symbol(s) not found for architecture x86_64 in Xcode 10 (ERROR)
I am facing the problem in my ios project. symbols not found for architecture x86_64 in Xcode clang: error: linker command failed with exit code 1 (use -v to see invocation). I nuked my xcode and project folder multiple times trying to get around this. I'm stuck. Any ideas? The log is below. I am trying to run a simulator build on Xcode 10.
Undefined symbols for architecture x86_64:
"google::LogMessage::LogMessage(char const*, int, int)", referenced from:
facebook::react::CxxNativeModule::invoke(unsigned int, folly::dynamic&&, int)::$_1::operator()() const in CxxNativeModule.o
facebook::react::JSException::buildMessage(OpaqueJSContext const*, OpaqueJSValue const*, OpaqueJSString*, char const*) in JSCHelpers.o
facebook::react::NativeToJsBridge::callFunction(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&, folly::dynamic&&)::$_1::operator()(facebook::react::JSExecutor*) const in NativeToJsBridge.o
facebook::react::NativeToJsBridge::invokeCallback(double, folly::dynamic&&)::$_2::operator()(facebook::react::JSExecutor*) const in NativeToJsBridge.o
"double_conversion::DoubleToStringConverter::ToShortestIeeeNumber(double, double_conversion::StringBuilder*, double_conversion::DoubleToStringConverter::DtoaMode) const", referenced from:
double_conversion::DoubleToStringConverter::ToShortest(double, double_conversion::StringBuilder*) const in CxxNativeModule.o
"double_conversion::DoubleToStringConverter::ToFixed(double, int, double_conversion::StringBuilder*) const", referenced from:
std::__1::enable_if<(std::is_floating_point<double>::value) && (IsSomeString<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value), void>::type folly::toAppend<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, double>(double, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in CxxNativeModule.o
std::__1::enable_if<(std::is_floating_point<double>::value) && (IsSomeString<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value), void>::type folly::toAppend<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, double>(double, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in JSCExecutor.o
std::__1::enable_if<(std::is_floating_point<double>::value) && (IsSomeString<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value), void>::type folly::toAppend<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, double>(double, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in MethodCall.o
std::__1::enable_if<(std::is_floating_point<double>::value) && (IsSomeString<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value), void>::type folly::toAppend<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, double>(double, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in Value.o
"double_conversion::DoubleToStringConverter::ToPrecision(double, int, double_conversion::StringBuilder*) const", referenced from:
std::__1::enable_if<(std::is_floating_point<double>::value) && (IsSomeString<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value), void>::type folly::toAppend<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, double>(double, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in CxxNativeModule.o
std::__1::enable_if<(std::is_floating_point<double>::value) && (IsSomeString<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value), void>::type folly::toAppend<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, double>(double, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in JSCExecutor.o
std::__1::enable_if<(std::is_floating_point<double>::value) && (IsSomeString<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value), void>::type folly::toAppend<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, double>(double, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in MethodCall.o
std::__1::enable_if<(std::is_floating_point<double>::value) && (IsSomeString<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value), void>::type folly::toAppend<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, double>(double, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in Value.o
"google::LogMessageFatal::LogMessageFatal(char const*, int)", referenced from:
std::__1::enable_if<(std::is_floating_point<double>::value) && (IsSomeString<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value), void>::type folly::toAppend<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, double>(double, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in CxxNativeModule.o
facebook::react::Instance::initializeBridge(std::__1::unique_ptr<facebook::react::InstanceCallback, std::__1::default_delete<facebook::react::InstanceCallback> >, std::__1::shared_ptr<facebook::react::JSExecutorFactory>, std::__1::shared_ptr<facebook::react::MessageQueueThread>, std::__1::shared_ptr<facebook::react::ModuleRegistry>) in Instance.o
facebook::react::JSBigFileString::fromPath(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)::$_0::operator()() const in JSBigString.o
facebook::react::JSBigFileString::c_str() const in JSBigString.o
facebook::react::JSCExecutor::~JSCExecutor() in JSCExecutor.o
facebook::react::JSCExecutor::callNativeModules(facebook::react::Value&&) in JSCExecutor.o
std::__1::enable_if<(std::is_floating_point<double>::value) && (IsSomeString<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value), void>::type folly::toAppend<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, double>(double, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in JSCExecutor.o
...
"google::LogMessage::stream()", referenced from:
std::__1::enable_if<(std::is_floating_point<double>::value) && (IsSomeString<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value), void>::type folly::toAppend<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, double>(double, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in CxxNativeModule.o
facebook::react::CxxNativeModule::invoke(unsigned int, folly::dynamic&&, int)::$_1::operator()() const in CxxNativeModule.o
facebook::react::Instance::initializeBridge(std::__1::unique_ptr<facebook::react::InstanceCallback, std::__1::default_delete<facebook::react::InstanceCallback> >, std::__1::shared_ptr<facebook::react::JSExecutorFactory>, std::__1::shared_ptr<facebook::react::MessageQueueThread>, std::__1::shared_ptr<facebook::react::ModuleRegistry>) in Instance.o
facebook::react::JSBigFileString::fromPath(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)::$_0::operator()() const in JSBigString.o
facebook::react::JSBigFileString::c_str() const in JSBigString.o
facebook::react::JSCExecutor::~JSCExecutor() in JSCExecutor.o
facebook::react::JSCExecutor::callNativeModules(facebook::react::Value&&) in JSCExecutor.o
...
"google::LogMessage::~LogMessage()", referenced from:
facebook::react::CxxNativeModule::invoke(unsigned int, folly::dynamic&&, int)::$_1::operator()() const in CxxNativeModule.o
facebook::react::JSException::buildMessage(OpaqueJSContext const*, OpaqueJSValue const*, OpaqueJSString*, char const*) in JSCHelpers.o
facebook::react::NativeToJsBridge::callFunction(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&, folly::dynamic&&)::$_1::operator()(facebook::react::JSExecutor*) const in NativeToJsBridge.o
facebook::react::NativeToJsBridge::invokeCallback(double, folly::dynamic&&)::$_2::operator()(facebook::react::JSExecutor*) const in NativeToJsBridge.o
"google::LogMessageFatal::~LogMessageFatal()", referenced from:
std::__1::enable_if<(std::is_floating_point<double>::value) && (IsSomeString<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value), void>::type folly::toAppend<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, double>(double, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in CxxNativeModule.o
facebook::react::Instance::initializeBridge(std::__1::unique_ptr<facebook::react::InstanceCallback, std::__1::default_delete<facebook::react::InstanceCallback> >, std::__1::shared_ptr<facebook::react::JSExecutorFactory>, std::__1::shared_ptr<facebook::react::MessageQueueThread>, std::__1::shared_ptr<facebook::react::ModuleRegistry>) in Instance.o
facebook::react::JSBigFileString::fromPath(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)::$_0::operator()() const in JSBigString.o
facebook::react::JSBigFileString::c_str() const in JSBigString.o
facebook::react::JSCExecutor::~JSCExecutor() in JSCExecutor.o
facebook::react::JSCExecutor::callNativeModules(facebook::react::Value&&) in JSCExecutor.o
std::__1::enable_if<(std::is_floating_point<double>::value) && (IsSomeString<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::value), void>::type folly::toAppend<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, double>(double, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in JSCExecutor.o
...
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Solution 1:[1]
Inside pods, under targets, click on React then, build phases > link Binary with libraries add DoubleConversion.Framework and glog.framework and Folly.framework. Whenever you do pod update please make sure these are added under react dependencies then run.
Solution 2:[2]
in React.podspec your need change
ss.compiler_flags = folly_compiler_flags
to
ss.dependency "DoubleConversion"
ss.dependency "GLog"
ss.compiler_flags = folly_compiler_flags
3 part
ps: GLog or glog
Solution 3:[3]
I am facing the same problem on 12 feb either. So I opened an issue for this problem on Github.
There is a workaround for this problem.
Manually adding DoubleConversion and glog to Link Binary With Libraries of React framework target in @CocoaPods project.
And this issue fixed in RN 0.58.4
Solution 4:[4]
Solution was so easy, when I Read error message....
Just add x86_64 arch to ur dependecy. I havent it, cuz i added React-Native to existed ios app, and it has some diff with app, which created with React-Native as default. React-logger -> Build Settings -> Architectures
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Neelam Soni |
Solution 2 | wenyou |
Solution 3 | crazy_phage |
Solution 4 | Yes.Skyscrapers |