2017-08-07 123 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

相關問題