[英]React Native iOS build failed : Undefined symbols for architecture x86_64
I'm building an iOS app with React Native. 我正在用React Native构建一个iOS应用。 Doing so, I installed a react-native module and configured my iOS xcode project (cocoapods mainly) following the module tutorial.
这样做,我安装了一个本机模块,并按照该模块教程配置了iOS xcode项目(主要是cocoapods)。 Now, when I run
react-native run-ios
, I get this error stack : 现在,当我运行
react-native run-ios
,出现以下错误堆栈:
Undefined symbols for architecture x86_64:
架构x86_64的未定义符号:
"_JSNoBytecodeFileFormatVersion", referenced from:
从以下位置引用的“ _JSNoBytecodeFileFormatVersion”
+[RCTJavaScriptLoader loadBundleAtURL:onProgress:onComplete:] in RCTJavaScriptLoader.o
+ [RCTJavaScriptLoader loadBundleAtURL:onProgress:onComplete:]在RCTJavaScriptLoader.o中
+[RCTJavaScriptLoader attemptSynchronousLoadOfBundleAtURL:runtimeBCVersion:sourceLength:error:] in RCTJavaScriptLoader.o "facebook::react::IRemoteConnection::~IRemoteConnection()", referenced from:
+ [RCTJavaScriptLoader trySynchronousLoadOfBundleAtURL:runtimeBCVersion:sourceLength:error:]在RCTJavaScriptLoader.o中的“ facebook :: react :: IRemoteConnection ::〜IRemoteConnection()”,引用自:
RemoteConnection::~RemoteConnection() in RCTInspector.o "facebook::react::parseTypeFromHeader(facebook::react::BundleHeader const&)", referenced from:
RCTInspector.o中的RemoteConnection ::〜RemoteConnection()“ facebook :: react :: parseTypeFromHeader(facebook :: react :: BundleHeader const&)”,引用自:
+[RCTJavaScriptLoader attemptSynchronousLoadOfBundleAtURL:runtimeBCVersion:sourceLength:error:] in RCTJavaScriptLoader.o
+ [RCTJavaScriptLoader trySynchronousLoadOfBundleAtURL:runtimeBCVersion:sourceLength:error:]在RCTJavaScriptLoader.o中
"facebook::react::customJSCWrapper()", referenced from:
“ facebook :: react :: customJSCWrapper()”,引用自:
-[RCTDevSettings isJSCSamplingProfilerAvailable] in RCTDevSettings.o
-RCTDevSettings.o中的[RCTDevSettings isJSCSamplingProfilerAvailable]
-[RCTDevSettings toggleJSCSamplingProfiler] in RCTDevSettings.o ____ZL11getInstancev_block_invoke in RCTInspector.o
-RCDevSettings.o中的[RCTDevSettings toggleJSCSamplingProfiler] __ RCTInspector.o中的____ZL11getInstancev_block_invoke
_RCTNSErrorFromJSErrorRef in RCTJSCErrorHandling.o
RCTJSCErrorHandling.o中的_RCTNSErrorFromJSErrorRef
-[RCTSamplingProfilerPackagerMethod handleRequest:withResponder:] in RCTSamplingProfilerPackagerMethod.o
-RCTSamplingProfilerPackagerMethod.o中的[RCTSamplingProfilerPackagerMethod handleRequest:withResponder:]
"facebook::react::systemJSCWrapper()", referenced from:
“ facebook :: react :: systemJSCWrapper()”,引用自:
-[RCTDevSettings isJSCSamplingProfilerAvailable] in RCTDevSettings.o
-RCTDevSettings.o中的[RCTDevSettings isJSCSamplingProfilerAvailable]
-[RCTDevSettings toggleJSCSamplingProfiler] in RCTDevSettings.o
-RCTDevSettings.o中的[RCTDevSettings toggleJSCSamplingProfiler]
_RCTNSErrorFromJSErrorRef in RCTJSCErrorHandling.o
RCTJSCErrorHandling.o中的_RCTNSErrorFromJSErrorRef
-[RCTSamplingProfilerPackagerMethod handleRequest:withResponder:] in RCTSamplingProfilerPackagerMethod.o
-RCTSamplingProfilerPackagerMethod.o中的[RCTSamplingProfilerPackagerMethod handleRequest:withResponder:]
ld: symbol(s) not found for architecture x86_64
ld:找不到架构x86_64的符号
clang: error: linker command failed with exit code 1 (use -v to see invocation)
clang:错误:链接器命令失败,退出代码为1(使用-v查看调用)
** BUILD FAILED **
**建立失败**
The following build commands failed:
以下构建命令失败:
Ld /Users/antoine/R/devlab/ReactNative/medway-twilio/MedwayTwilio/ios/build/Build/Products/Debug-iphonesimulator/React/React.framework/React normal x86_64 (1 failure)
ld /用户/antoine/R/devlab/ReactNative/medway-twilio/MedwayTwilio/ios/build/Build/Products/Debug-iphonesimulator/React/React.framework/React正常x86_64(1次失败)
I suspect this is related to the inclusion of libraries and frameworks to the project with xcode, but I'm not sure. 我怀疑这与使用xcode将库和框架包含到项目中有关,但是我不确定。
This is a screenshot of my project target/build phases/link binary with libraries panel in xcode : 这是xcode中我的项目目标/构建阶段/带有库面板的二进制链接的屏幕截图:
Where "MedwayTwilio" is my project name 其中“ MedwayTwilio”是我的项目名称
Did you configured your CocoaPods dependencies as described in the documentation ? 您是否按照文档中所述配置了CocoaPods依赖项?
Also, you need to add a dependency on the RCTBatchedBridge subspec (if using 0.46) or RCTCxxBridge (if newer). 另外,您需要添加对RCTBatchedBridge子规范(如果使用0.46)或RCTCxxBridge(如果较新)的依赖项。
pod 'React', :path => '../node_modules/react-native', :subspecs => [
'Core',
'DevSupport', # Include this to enable In-App Devmenu if RN >= 0.43
[...]
'BatchedBridge', # Include if RN = 0.46
'CxxBridge' # Include if RN >= 0.47
]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.