RN升级到0.48.x时, xcode运行报错:
Undefined symbols for architecture x86_64: "_JSNoBytecodeFileFormatVersion", referenced from: +[RCTJavaScriptLoader loadBundleAtURL:onProgress:onComplete:] in libReact.a(RCTJavaScriptLoader.o) +[RCTJavaScriptLoader attemptSynchronousLoadOfBundleAtURL:runtimeBCVersion:sourceLength:error:] in libReact.a(RCTJavaScriptLoader.o) "facebook::react::IRemoteConnection::~IRemoteConnection()", referenced from: RemoteConnection::~RemoteConnection() in libReact.a(RCTInspector.o) "facebook::react::systemJSCWrapper()", referenced from: -[RCTSamplingProfilerPackagerMethod handleRequest:withResponder:] in libReact.a(RCTSamplingProfilerPackagerMethod.o) -[RCTDevSettings isJSCSamplingProfilerAvailable] in libReact.a(RCTDevSettings.o) -[RCTDevSettings toggleJSCSamplingProfiler] in libReact.a(RCTDevSettings.o) "facebook::react::parseTypeFromHeader(facebook::react::BundleHeader const&)", referenced from: +[RCTJavaScriptLoader attemptSynchronousLoadOfBundleAtURL:runtimeBCVersion:sourceLength:error:] in libReact.a(RCTJavaScriptLoader.o) "facebook::react::customJSCWrapper()", referenced from: ____ZL11getInstancev_block_invoke in libReact.a(RCTInspector.o) -[RCTSamplingProfilerPackagerMethod handleRequest:withResponder:] in libReact.a(RCTSamplingProfilerPackagerMethod.o) -[RCTDevSettings isJSCSamplingProfilerAvailable] in libReact.a(RCTDevSettings.o) -[RCTDevSettings toggleJSCSamplingProfiler] in libReact.a(RCTDevSettings.o) ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
解决方法:
在podfile文件中添加React库支持
pod 'React', path: '../../node_modules/react-native', :subspecs => [
...,
'BatchedBridge',
...
]
完美解决问题...
网友评论