ReactNative 嵌入到现有原生应用

pod react到项目时会出现如下错误

[!] No podspec found for `Yoga` in `../reactnative/node_modules/react-native/ReactCommon/yoga`

完整的Podfile如下

注意: Podfile目录和 .xcodeproj 一致
 platform :ios, '9.0'

target '你的项目名’ do 
#必须加下面这句 否则会报[!] No podspec found for `Yoga` in `../reactnative/node_modules/react-native/ReactCommon/yoga` 
pod 'Yoga', :path => ‘./reactnative/node_modules/react-native/ReactCommon/yoga'
pod 'React', :path => './reactnative/node_modules/react-native', :subspecs => [  
  ’Core',
  ’RCTNetwork',
  ’RCTText',
  'RCTWebSocket',
 # 添加其他你想在工程中使用的依赖。
]
end

参考文章

1.http://www.cnblogs.com/xiaoyouPrince/p/6668533.html

2 http://reactnative.cn/docs/0.44/integration-with-existing-apps.html#content

你可能感兴趣的:(ReactNative 嵌入到现有原生应用)