React native,pod install不安装subspecs

时间:2017-07-24 04:00:59

标签: react-native react-native-ios

RN教程github项目看起来像这样, enter image description here

而我的只有Core

enter image description here

我尝试了rm -rf Pods && rm -rf "${HOME}/Library/Caches/CocoaPods"pod install

1 个答案:

答案 0 :(得分:1)

通过遵循React Native指南https://facebook.github.io/react-native/docs/integration-with-existing-apps.html并使用如下的pod文件,我能够从一个全新的swift项目中安装子目录:

target 'testpods' do
  # Your 'node_modules' directory is probably in the root of your project,
  # but if not, adjust the `:path` accordingly
  pod 'React', :path => './node_modules/react-native', :subspecs => [
    'Core',
    'DevSupport', # Include this to enable In-App Devmenu if RN >= 0.43
    'RCTText',
    'RCTNetwork',
    'RCTWebSocket', # needed for debugging
    # Add any other subspecs you want to use in your project
  ]
  # Explicitly include Yoga if you are using RN >= 0.42.0
  pod "Yoga", :path => "./node_modules/react-native/ReactCommon/yoga"
end
相关问题