Xcode IOS中的React Native Expo-愚蠢问题
在XCode中构建ExjectedExpo33项目时,我们得到了以下信息:(在Android中工作良好) 架构x86_64的未定义符号: “富利::动态::getDefault(富利::动态常量&,富利::动态&&)常量&”,引用自: libReact.a(JSCExecutor.o)中的facebook::react::JSCExecutor::initOnJSVMThread() “folly::dynamic::at(folly::dynamic const&)const&”,引用自: libReact.a(Value.o)中的folly::dynamic::operator[](folly::dynamic const&)const&) “folly::dynamic::operator[](folly::dynamic const&)&”,引用自: libReact.a(ModuleRegistry.o)中的facebook::react::ModuleRegistry::getConfig(std::u 1::basic_string const&) libReact.a(cxnativemodule.o)中的facebook::react::cxnativemodule::invoke(unsigned int,folly::dynamic&&,int) libReact.a(MethodCall.o)中的facebook::react::parseMethodCalls(folly::dynamic&&) ld:找不到架构x86_64的符号 叮当声:错误:链接器命令失败,退出代码为1(使用-v查看调用) 通常,这指向一个有问题的Podspec文件,但是与默认的Podspec文件相比,Podspec文件看起来很可靠(以下供参考)Xcode IOS中的React Native Expo-愚蠢问题,xcode,expo,Xcode,Expo,在XCode中构建ExjectedExpo33项目时,我们得到了以下信息:(在Android中工作良好) 架构x86_64的未定义符号: “富利::动态::getDefault(富利::动态常量&,富利::动态&&)常量&”,引用自: libReact.a(JSCExecutor.o)中的facebook::react::JSCExecutor::initOnJSVMThread() “folly::dynamic::at(folly::dynamic const&)const&”,引用自: l
源代码'https://github.com/CocoaPods/Specs.git'
平台:ios,“10.0”
目标“项目名称”do
pod“ExpoKit”,
:git=>“http://github.com/expo/expo.git",
:tag=>“ios/2.11.0”,
:subsecs=>[
“核心”
],
:禁止警告=>true
#安装Unicode模块
require_relative'../node_modules/react native unimodules/cocoapods.rb'
使用_unimodules!
吊舱“反应”,
:path=>“./node_modules/react native”,
:禁止警告=>true,
:subsecs=>[
“核心”,
“艺术”,
“RCTActionSheet”,
“RCTAnimation”,
“RCTCameraRoll”,
“RCTGeolocation”,
“RCTImage”,
“RCT网络”,
“RCTText”,
“RCTVibration”,
“RCTWebSocket”,
“DevSupport”,
“CxxBridge”
]
pod“瑜伽”,
:path=>“./node_modules/react native/react common/yoga”,
:禁止警告=>true
pod“双重转换”,
:podspec=>“./node_modules/react native/third party podspecs/DoubleConversion.podspec”,
:禁止警告=>true
“愚蠢”,
:podspec=>“./node_modules/react native/third party podspecs/Folly.podspec”,
:禁止警告=>true
吊舱“glog”,
:podspec=>“./node_modules/react native/third party podspecs/glog.podspec”,
:禁止警告=>true
吊舱'rn fetch blob',
:path=>“../node_modules/rn fetch blob”
pod'RNDeviceInfo',:path=>“../node_modules/react native device info”
安装后的do安装程序|
installer.pods_project.main_group.tab_width='2';
installer.pods_project.main_group.indent_width='2';
installer.pods_project.targets.each do| target|
如果target.name==“React”
target.remove_from_项目
结束
#它将React&Yoga从Pods项目中删除,因为它已经包含在主项目中。
目标\u到\u忽略=%w(反应)
如果目标被忽略,包括?target.name
target.remove_from_项目
结束
结束
安装程序.target\u安装结果.pod\u目标安装结果
.每个do |吊舱|名称、目标|安装|结果|
如果pod_name==“ExpoKit”
target_installation_result.native_target.build_configurations.each do|config|
config.build_设置['GCC_预处理器_定义]]| |=['$(继承)]
config.build\u设置['GCC\u预处理器\u定义']
Undefined symbols for architecture x86_64:
"folly::dynamic::getDefault(folly::dynamic const&, folly::dynamic&&) const &", referenced from:
facebook::react::JSCExecutor::initOnJSVMThread() in libReact.a(JSCExecutor.o)
"folly::dynamic::at(folly::dynamic const&) const &", referenced from:
folly::dynamic::operator[](folly::dynamic const&) const & in libReact.a(Value.o)
"folly::dynamic::operator[](folly::dynamic const&) &", referenced from:
facebook::react::ModuleRegistry::getConfig(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in libReact.a(ModuleRegistry.o)
facebook::react::CxxNativeModule::invoke(unsigned int, folly::dynamic&&, int) in libReact.a(CxxNativeModule.o)
facebook::react::parseMethodCalls(folly::dynamic&&) in libReact.a(MethodCall.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
target 'project-name' do
pod 'ExpoKit',
:git => "http://github.com/expo/expo.git",
:tag => "ios/2.11.0",
:subspecs => [
"Core"
],
:inhibit_warnings => true
# Install unimodules
require_relative '../node_modules/react-native-unimodules/cocoapods.rb'
use_unimodules!
pod 'React',
:path => "../node_modules/react-native",
:inhibit_warnings => true,
:subspecs => [
"Core",
"ART",
"RCTActionSheet",
"RCTAnimation",
"RCTCameraRoll",
"RCTGeolocation",
"RCTImage",
"RCTNetwork",
"RCTText",
"RCTVibration",
"RCTWebSocket",
"DevSupport",
"CxxBridge"
]
pod 'yoga',
:path => "../node_modules/react-native/ReactCommon/yoga",
:inhibit_warnings => true
pod 'DoubleConversion',
:podspec => "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec",
:inhibit_warnings => true
pod 'Folly',
:podspec => "../node_modules/react-native/third-party-podspecs/Folly.podspec",
:inhibit_warnings => true
pod 'glog',
:podspec => "../node_modules/react-native/third-party-podspecs/glog.podspec",
:inhibit_warnings => true
pod 'rn-fetch-blob',
:path => '../node_modules/rn-fetch-blob'
pod 'RNDeviceInfo', :path => '../node_modules/react-native-device-info'
post_install do |installer|
installer.pods_project.main_group.tab_width = '2';
installer.pods_project.main_group.indent_width = '2';
installer.pods_project.targets.each do |target|
if target.name == "React"
target.remove_from_project
end
# It removes React & Yoga from the Pods project, as it is already included in the main project.
targets_to_ignore = %w(React yoga)
if targets_to_ignore.include? target.name
target.remove_from_project
end
end
installer.target_installation_results.pod_target_installation_results
.each do |pod_name, target_installation_result|
if pod_name == 'ExpoKit'
target_installation_result.native_target.build_configurations.each do |config|
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)']
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'EX_DETACHED=1'
# Enable Google Maps support
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'HAVE_GOOGLE_MAPS=1'
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'HAVE_GOOGLE_MAPS_UTILS=1'
end
end
if ['Amplitude-iOS','Analytics','AppAuth','Branch','CocoaLumberjack','FBSDKCoreKit','FBSDKLoginKit','FBSDKShareKit','GPUImage','JKBigInteger2'].include? pod_name
target_installation_result.native_target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '10.0'
end
end
# Can't specify this in the React podspec because we need to use those podspecs for detached
# projects which don't reference ExponentCPP.
if pod_name.start_with?('React')
target_installation_result.native_target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '10.0'
config.build_settings['HEADER_SEARCH_PATHS'] ||= ['$(inherited)']
end
end
# Build React Native with RCT_DEV enabled and RCT_ENABLE_INSPECTOR and
# RCT_ENABLE_PACKAGER_CONNECTION disabled
next unless pod_name == 'React'
target_installation_result.native_target.build_configurations.each do |config|
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)']
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'RCT_DEV=1'
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'RCT_ENABLE_INSPECTOR=0'
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'ENABLE_PACKAGER_CONNECTION=0'
end
end
end
end