From 00392ac46b6319dcff2b6df2e5f7bb4ee094612f Mon Sep 17 00:00:00 2001 From: Alejandro Ruperez Date: Wed, 13 Feb 2019 08:36:23 -0800 Subject: [PATCH] Resolves #23390: cxxreact, jsi and jsiexecutor depends on DoubleConversion and glog. (#23430) Summary: Resolves #23390: **cxxreact**, **jsi** and **jsiexecutor** depends on **DoubleConversion** and **glog**. This cause: ``` Undefined symbols for architecture x86_64: "google::LogMessage::LogMessage(char const*, int, int)", referenced from: std::__1::__function::__func, void ()>::operator()() in CxxNativeModule.o std::__1::__function::__func, std::__1::allocator >&&, std::__1::basic_string, std::__1::allocator >&&, folly::dynamic&&)::$_1, std::__1::allocator, std::__1::allocator >&&, std::__1::basic_string, std::__1::allocator >&&, folly::dynamic&&)::$_1>, void (facebook::react::JSExecutor*)>::operator()(facebook::react::JSExecutor*&&) in NativeToJsBridge.o std::__1::__function::__func, void (facebook::react::JSExecutor*)>::operator()(facebook::react::JSExecutor*&&) in NativeToJsBridge.o "double_conversion::DoubleToStringConverter::ToShortestIeeeNumber(double, double_conversion::StringBuilder*, double_conversion::DoubleToStringConverter::DtoaMode) const", referenced from: std::__1::enable_if<(std::is_floating_point::value) && (IsSomeString, std::__1::allocator > >::value), void>::type folly::toAppend, std::__1::allocator >, double>(double, std::__1::basic_string, std::__1::allocator >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in CxxNativeModule.o std::__1::enable_if<(std::is_floating_point::value) && (IsSomeString, std::__1::allocator > >::value), void>::type folly::toAppend, std::__1::allocator >, double>(double, std::__1::basic_string, std::__1::allocator >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in JSIDynamic.o double_conversion::DoubleToStringConverter::ToShortest(double, double_conversion::StringBuilder*) const in JSIDynamic.o double_conversion::DoubleToStringConverter::ToShortestSingle(float, double_conversion::StringBuilder*) const in JSIDynamic.o std::__1::enable_if<(std::is_floating_point::value) && (IsSomeString, std::__1::allocator > >::value), void>::type folly::toAppend, std::__1::allocator >, double>(double, std::__1::basic_string, std::__1::allocator >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in JSIExecutor.o std::__1::enable_if<(std::is_floating_point::value) && (IsSomeString, std::__1::allocator > >::value), void>::type folly::toAppend, std::__1::allocator >, double>(double, std::__1::basic_string, std::__1::allocator >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in MethodCall.o "double_conversion::DoubleToStringConverter::ToFixed(double, int, double_conversion::StringBuilder*) const", referenced from: std::__1::enable_if<(std::is_floating_point::value) && (IsSomeString, std::__1::allocator > >::value), void>::type folly::toAppend, std::__1::allocator >, double>(double, std::__1::basic_string, std::__1::allocator >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in CxxNativeModule.o std::__1::enable_if<(std::is_floating_point::value) && (IsSomeString, std::__1::allocator > >::value), void>::type folly::toAppend, std::__1::allocator >, double>(double, std::__1::basic_string, std::__1::allocator >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in JSIDynamic.o std::__1::enable_if<(std::is_floating_point::value) && (IsSomeString, std::__1::allocator > >::value), void>::type folly::toAppend, std::__1::allocator >, double>(double, std::__1::basic_string, std::__1::allocator >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in JSIExecutor.o std::__1::enable_if<(std::is_floating_point::value) && (IsSomeString, std::__1::allocator > >::value), void>::type folly::toAppend, std::__1::allocator >, double>(double, std::__1::basic_string, std::__1::allocator >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in MethodCall.o "google::LogMessageFatal::LogMessageFatal(char const*, int)", referenced from: std::__1::enable_if<(std::is_floating_point::value) && (IsSomeString, std::__1::allocator > >::value), void>::type folly::toAppend, std::__1::allocator >, double>(double, std::__1::basic_string, std::__1::allocator >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in CxxNativeModule.o facebook::react::Instance::initializeBridge(std::__1::unique_ptr >, std::__1::shared_ptr, std::__1::shared_ptr, std::__1::shared_ptr) in Instance.o folly::detail::ScopeGuardImpl, std::__1::allocator > const&)::$_0, true>::~ScopeGuardImpl() in JSBigString.o facebook::react::JSBigFileString::c_str() const in JSBigString.o facebook::jsi::valueFromDynamic(facebook::jsi::Runtime&, folly::dynamic const&) in JSIDynamic.o std::__1::enable_if<(std::is_floating_point::value) && (IsSomeString, std::__1::allocator > >::value), void>::type folly::toAppend, std::__1::allocator >, double>(double, std::__1::basic_string, std::__1::allocator >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in JSIDynamic.o facebook::react::JSIExecutor::callNativeModules(facebook::jsi::Value const&, bool) in JSIExecutor.o ... "double_conversion::DoubleToStringConverter::ToPrecision(double, int, double_conversion::StringBuilder*) const", referenced from: std::__1::enable_if<(std::is_floating_point::value) && (IsSomeString, std::__1::allocator > >::value), void>::type folly::toAppend, std::__1::allocator >, double>(double, std::__1::basic_string, std::__1::allocator >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in CxxNativeModule.o std::__1::enable_if<(std::is_floating_point::value) && (IsSomeString, std::__1::allocator > >::value), void>::type folly::toAppend, std::__1::allocator >, double>(double, std::__1::basic_string, std::__1::allocator >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in JSIDynamic.o std::__1::enable_if<(std::is_floating_point::value) && (IsSomeString, std::__1::allocator > >::value), void>::type folly::toAppend, std::__1::allocator >, double>(double, std::__1::basic_string, std::__1::allocator >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in JSIExecutor.o std::__1::enable_if<(std::is_floating_point::value) && (IsSomeString, std::__1::allocator > >::value), void>::type folly::toAppend, std::__1::allocator >, double>(double, std::__1::basic_string, std::__1::allocator >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in MethodCall.o "google::LogMessage::stream()", referenced from: std::__1::enable_if<(std::is_floating_point::value) && (IsSomeString, std::__1::allocator > >::value), void>::type folly::toAppend, std::__1::allocator >, double>(double, std::__1::basic_string, std::__1::allocator >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in CxxNativeModule.o std::__1::__function::__func, void ()>::operator()() in CxxNativeModule.o facebook::react::Instance::initializeBridge(std::__1::unique_ptr >, std::__1::shared_ptr, std::__1::shared_ptr, std::__1::shared_ptr) in Instance.o folly::detail::ScopeGuardImpl, std::__1::allocator > const&)::$_0, true>::~ScopeGuardImpl() in JSBigString.o facebook::react::JSBigFileString::c_str() const in JSBigString.o facebook::jsi::valueFromDynamic(facebook::jsi::Runtime&, folly::dynamic const&) in JSIDynamic.o std::__1::enable_if<(std::is_floating_point::value) && (IsSomeString, std::__1::allocator > >::value), void>::type folly::toAppend, std::__1::allocator >, double>(double, std::__1::basic_string, std::__1::allocator >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in JSIDynamic.o ... "google::LogMessage::~LogMessage()", referenced from: std::__1::__function::__func, void ()>::operator()() in CxxNativeModule.o std::__1::__function::__func, std::__1::allocator >&&, std::__1::basic_string, std::__1::allocator >&&, folly::dynamic&&)::$_1, std::__1::allocator, std::__1::allocator >&&, std::__1::basic_string, std::__1::allocator >&&, folly::dynamic&&)::$_1>, void (facebook::react::JSExecutor*)>::operator()(facebook::react::JSExecutor*&&) in NativeToJsBridge.o std::__1::__function::__func, void (facebook::react::JSExecutor*)>::operator()(facebook::react::JSExecutor*&&) in NativeToJsBridge.o "google::LogMessageFatal::~LogMessageFatal()", referenced from: std::__1::enable_if<(std::is_floating_point::value) && (IsSomeString, std::__1::allocator > >::value), void>::type folly::toAppend, std::__1::allocator >, double>(double, std::__1::basic_string, std::__1::allocator >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in CxxNativeModule.o facebook::react::Instance::initializeBridge(std::__1::unique_ptr >, std::__1::shared_ptr, std::__1::shared_ptr, std::__1::shared_ptr) in Instance.o folly::detail::ScopeGuardImpl, std::__1::allocator > const&)::$_0, true>::~ScopeGuardImpl() in JSBigString.o facebook::react::JSBigFileString::c_str() const in JSBigString.o facebook::jsi::valueFromDynamic(facebook::jsi::Runtime&, folly::dynamic const&) in JSIDynamic.o std::__1::enable_if<(std::is_floating_point::value) && (IsSomeString, std::__1::allocator > >::value), void>::type folly::toAppend, std::__1::allocator >, double>(double, std::__1::basic_string, std::__1::allocator >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int) in JSIDynamic.o facebook::react::JSIExecutor::callNativeModules(facebook::jsi::Value const&, bool) in JSIExecutor.o ... ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` [iOS] [Fixed] - Added `DoubleConversion` and `glog` to `cxxreact`, `jsi` and `jsiexecutor` subspecs in `React.podspec` file. The goal of this PR is to have no need to fix #23390 by manually adding **DoubleConversion** and **glog** to _Link Binary With Libraries_ of **React** framework target in cocoapods project. ![captura de pantalla 2019-02-12 a las 17 12 05](https://user-images.githubusercontent.com/297950/52650102-deb25e80-2ee9-11e9-9595-f7fbd4730671.png) Pull Request resolved: https://github.com/facebook/react-native/pull/23430 Differential Revision: D14065309 Pulled By: cpojer fbshipit-source-id: 4318c3770c54087f198856c983f7cb73ff30000f --- React.podspec | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/React.podspec b/React.podspec index a5d06285f..505264cad 100644 --- a/React.podspec +++ b/React.podspec @@ -116,6 +116,8 @@ Pod::Spec.new do |s| ss.dependency "React/cxxreact" ss.dependency "React/jsi" ss.dependency "Folly", folly_version + ss.dependency "DoubleConversion" + ss.dependency "glog" ss.compiler_flags = folly_compiler_flags ss.source_files = "ReactCommon/jsiexecutor/jsireact/*.{cpp,h}" ss.private_header_files = "ReactCommon/jsiexecutor/jsireact/*.h" @@ -125,6 +127,8 @@ Pod::Spec.new do |s| s.subspec "jsi" do |ss| ss.dependency "Folly", folly_version + ss.dependency "DoubleConversion" + ss.dependency "glog" ss.compiler_flags = folly_compiler_flags ss.source_files = "ReactCommon/jsi/*.{cpp,h}" ss.private_header_files = "ReactCommon/jsi/*.h" @@ -142,6 +146,8 @@ Pod::Spec.new do |s| ss.dependency "React/jsinspector" ss.dependency "boost-for-react-native", "1.63.0" ss.dependency "Folly", folly_version + ss.dependency "DoubleConversion" + ss.dependency "glog" ss.compiler_flags = folly_compiler_flags ss.source_files = "ReactCommon/cxxreact/*.{cpp,h}" ss.exclude_files = "ReactCommon/cxxreact/SampleCxxModule.*"