React-Native集成到本地项目报错

报错信息如下:


Undefined symbols for architecture x86_64:
  "facebook::react::customJSCWrapper()", referenced from:
      -[RCTDevSettings isJSCSamplingProfilerAvailable] in libReact.a(RCTDevSettings.o)
      -[RCTDevSettings toggleJSCSamplingProfiler] in libReact.a(RCTDevSettings.o)
  "facebook::react::systemJSCWrapper()", referenced from:
      -[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)
  "_JSNoBytecodeFileFormatVersion", referenced from:
      +[RCTJavaScriptLoader loadBundleAtURL:onProgress:onComplete:] in libReact.a(RCTJavaScriptLoader.o)
      +[RCTJavaScriptLoader attemptSynchronousLoadOfBundleAtURL:runtimeBCVersion:sourceLength:error:] in libReact.a(RCTJavaScriptLoader.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

从react-native 0.45.0版本以后,Podfile文件中要加入“ BatchedBridge”
Podfile文件如下:

platform :ios, '8.0'
target "RNHybrid" do  #记得改项目名

pod 'Yoga',  :path => ‘./RN/node_modules/react-native/ReactCommon/yoga'
pod 'React', :path => ‘./RN/node_modules/react-native', :subspecs => [
 'Core',
 'RCTText',
 'RCTNetwork’,
 'RCTWebSocket',
 'BatchedBridge',
]

end

你可能感兴趣的:(React-Native集成到本地项目报错)