Reputation: 1293
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
Upvotes: 1
Views: 5353
Reputation: 1118
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
]
Upvotes: 6