2017-08-07 84 views
0

我正在使用React Native构建iOS应用程序。这样做,我安装了一个react-native module并在模块教程之后配置了我的iOS xcode项目(主要是cocoapods)。现在,当我运行react-native run-ios,我得到这个错误堆栈:React Native iOS构建失败:体系结构x86_64的未定义符号

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)

我怀疑这是关系到包括库和框架与Xcode中的项目,但我不知道。

这是我的项目目标的截图/建造阶段/链接二进制与图书馆面板在Xcode:

Libraries

其中“MedwayTwilio”是我的项目名称

+0

您能否告诉我更多的信息,例如在您的iOS项目中的库的一部分 –

+0

您是否尝试运行react-native链接? –

+0

@JulienKode我添加了一个截图,如果这是你所要求的。 react-native链接告诉我我的库已经链接 –

回答

4

你配置你的CocoaPods依赖描述in the documentation?另外,您需要添加对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 
    ] 
+0

我在文档 – AlxVallejo

+0

中看不到'CxxBridge'#include if RN> = 0.47'添加'BatchedBridge'子规格为我解决了这个问题。 – BillyRayCyrus

相关问题