简体   繁体   English

React Native Podfile子规范未添加到项目

[英]React Native Podfile subspecs are not added to project

I'm seeing the same error described here with React-native 0.19.0 in an iOS app. 我看到描述了同样的错误在这里在iOS应用程序与阵营本地0.19.0。

Error: undefined is not an object (evaluating \'RCTWebSocketManager.connect\')

I have an existing project and followed the steps in the Integrating with Existing Apps documentation. 我有一个现有项目,并按照与现有应用程序集成文档中的步骤进行操作。 None of the answers from the existing question worked for me. 现有问题的答案都没有对我有用。

My Podfile is exactly like the example shown in the React Native documentation: 我的Podfile与React Native文档中显示的示例完全一样:

pod 'React', :path => './node_modules/react-native', :subspecs => [
  'Core',
  'RCTImage',
  'RCTNetwork',
  'RCTText',
  'RCTWebSocket'   
]

After a pod install , the Pods in my Xcode project only contain the React Core library, not the libraries listed in the subspecs. pod install之后,我的Xcode项目中的Pod仅包含React Core库,而不包含子规范中列出的库。

To convince myself that it wasn't a conflict with other dependencies listed in my Podfile, I created a brand new project, followed the steps in the documentation, and got the same results. 为了使自己确信与Podfile中列出的其他依赖项没有冲突,我创建了一个全新的项目,按照文档中的步骤进行操作,并获得相同的结果。

Any suggestions for what to try next are much appreciated. 对于下一步尝试的任何建议都将受到赞赏。

Try correcting node_modules path. 尝试更正node_modules路径。 Right now it is './node_modules/react-native'. 现在是'./node_modules/react-native'。 Try to change it to '../node_modules/react-native' 尝试将其更改为“ ../node_modules/react-native”

hope this helps 希望这可以帮助

 pod 'React', :path => '../node_modules/react-native', :subspecs => [ 'Core', 'RCTText', 'RCTNetwork', 'RCTWebSocket' ] 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM