React Native iOS构建失败:架构x86_64的未定义符号 [英] React Native iOS build failed : Undefined symbols for architecture x86_64

查看:480
本文介绍了React Native iOS构建失败:架构x86_64的未定义符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用React Native构建一个iOS应用。这样做,我安装了



其中 MedwayTwilio是我的项目名称

解决方案

您是否按照



此外,您还需要添加依赖项

  pod'React',:path =>上的RCTBatchedBridge子规范(如果使用0.46)或RCTCxxBridge(如果使用较新)。 ‘../node_modules/react-native’,:subspecs => [
'Core',
'DevSupport',#如果RN> = 0.43
[...]
'BatchedBridge',#包括此项以启用应用内开发菜单如果RN = 0.46
'CxxBridge'#包括如果RN> = 0.47
]


I'm building an iOS app with React Native. Doing so, I installed a react-native module and configured my iOS xcode project (cocoapods mainly) following the module tutorial. Now, when I run react-native run-ios, I get this error stack :

Undefined symbols for architecture x86_64:

"_JSNoBytecodeFileFormatVersion", referenced from:

+[RCTJavaScriptLoader loadBundleAtURL:onProgress:onComplete:] in RCTJavaScriptLoader.o

+[RCTJavaScriptLoader attemptSynchronousLoadOfBundleAtURL:runtimeBCVersion:sourceLength:error:] in RCTJavaScriptLoader.o "facebook::react::IRemoteConnection::~IRemoteConnection()", referenced from:

RemoteConnection::~RemoteConnection() in RCTInspector.o "facebook::react::parseTypeFromHeader(facebook::react::BundleHeader const&)", referenced from:

+[RCTJavaScriptLoader attemptSynchronousLoadOfBundleAtURL:runtimeBCVersion:sourceLength:error:] in RCTJavaScriptLoader.o

"facebook::react::customJSCWrapper()", referenced from:

-[RCTDevSettings isJSCSamplingProfilerAvailable] in RCTDevSettings.o

-[RCTDevSettings toggleJSCSamplingProfiler] in RCTDevSettings.o ____ZL11getInstancev_block_invoke in RCTInspector.o

_RCTNSErrorFromJSErrorRef in RCTJSCErrorHandling.o

-[RCTSamplingProfilerPackagerMethod handleRequest:withResponder:] in RCTSamplingProfilerPackagerMethod.o

"facebook::react::systemJSCWrapper()", referenced from:

-[RCTDevSettings isJSCSamplingProfilerAvailable] in RCTDevSettings.o

-[RCTDevSettings toggleJSCSamplingProfiler] in RCTDevSettings.o

_RCTNSErrorFromJSErrorRef in RCTJSCErrorHandling.o

-[RCTSamplingProfilerPackagerMethod handleRequest:withResponder:] in RCTSamplingProfilerPackagerMethod.o

ld: symbol(s) not found for architecture x86_64

clang: error: linker command failed with exit code 1 (use -v to see invocation)

** 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)

I suspect this is related to the inclusion of libraries and frameworks to the project with xcode, but I'm not sure.

This is a screenshot of my project target/build phases/link binary with libraries panel in xcode :

Where "MedwayTwilio" is my project name

解决方案

Did you configured your CocoaPods dependencies as described in the documentation?

Also, you need to add a dependency on the RCTBatchedBridge subspec (if using 0.46) or RCTCxxBridge (if newer).

  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
  ]

这篇关于React Native iOS构建失败:架构x86_64的未定义符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆