未定义不是一个对象(评估'RCTWebSockerManager.connect') - 反应原生

问题描述:

我一直在关注如何整合现有的应用程序与反应原生指南。 http://facebook.github.io/react-native/docs/embedded-app-ios.html#content未定义不是一个对象(评估'RCTWebSockerManager.connect') - 反应原生

我根据IOS人员的建议,在IOS方面采取了一些*度。当我的看法负荷,我得到一个堆栈跟踪一个红色的错误画面:

http://puu.sh/jRgDg/b844f139b2.png

(对不起,没有足够的信誉发表图片的文本包含下面。)

2015-08-27 22:19:37.739 [error][tid:com.facebook.React.JavaScript] 'Warning: Native component for "RCTImageView" does not exist' 2015-08-27 22:19:37.851 [info][tid:com.facebook.React.JavaScript] 'Running application "SimpleApp" with appParams: {"rootTag":1,"initialProps":{}}. __DEV__ === true, development-level warning are ON, performance optimizations are OFF' 2015-08-27 22:19:37.856 [error][tid:com.facebook.React.JavaScript] 'Error: undefined is not an object (evaluating \'RCTWebSocketManager.connect\') stack: connectToSocketImpl index.ios.bundle:14464 WebSocketBase index.ios.bundle:14587 WebSocket index.ios.bundle:14458 setupDevtools index.ios.bundle:46060 renderApplication index.ios.bundle:44403 run index.ios.bundle:44295 runApplication index.ios.bundle:44323 __callFunction index.ios.bundle:5552 <unknown> index.ios.bundle:5488 guard index.ios.bundle:5441 <unknown> index.ios.bundle:5488 <unknown> index.ios.bundle:5485 perform index.ios.bundle:7033 batchedUpdates index.ios.bundle:16454 batchedUpdates index.ios.bundle:6336 <unknown> index.ios.bundle:5484 guard index.ios.bundle:5441 processBatch index.ios.bundle:5483 URL: http://192.168.1.70:8081/index.ios.bundle line: 14464 message: undefined is not an object (evaluating \'RCTWebSocketManager.connect\')'

这里是我的Podfile:

pod 'FBSDKShareKit' 
pod 'FBSDKCoreKit' 
pod 'FBSDKLoginKit' 
pod 'React' 
pod 'React/RCTText' 

(“URL:”被更改为手动,而不是本地主机,但响应的SAM e。在浏览器)

当我运行:

(JS_DIR=`pwd`/ReactComponent; cd Pods/React; npm run start -- --root $JS_DIR) 

一切都正常运行了日志yeilding:

[22:32:15] <START> fs crawl 
[22:32:16] <END> fs crawl (744ms) 
[22:32:16] <START> Building in-memory fs 
[22:32:16] <END> Building in-memory fs (454ms) 
[22:32:16] <START> Building in-memory fs 
[22:32:17] <END> Building in-memory fs (242ms) 
[22:32:17] <START> Building Haste Map 
[22:32:17] <START> Building (deprecated) Asset Map 
[22:32:17] <END> Building (deprecated) Asset Map (75ms) 
[22:32:17] <END> Building Haste Map (836ms) 

一旦我开始了在Xcode项目IOS模拟器我得到前述的堆栈跟踪。我可以包含我的客观c代码,如果它会有帮助,但我省略了防止混乱,因为它似乎是反应依赖关系的问题。

谢谢!任何帮助表示赞赏。

+0

同一问题在这里:/ – gran33

所以我想通了。如果你有这个问题,修复我的podfile到这个工作。删除Pods /目录,然后使用以下podfile再次运行pod安装。重新启动开发者服务器也是很好的措施。

pod 'FBSDKShareKit' pod 'FBSDKCoreKit' pod 'FBSDKLoginKit' pod 'React' pod 'React', :subspecs => [ 'RCTText', 'RCTImage', 'RCTNetwork', 'RCTWebSocket' ]

您是否正在运行最新的XCode?建议使用6.3+。

见要求:https://facebook.github.io/react-native/docs/getting-started.html

我更新到6.4的Xcode和它固定的RCTWebSocketManager.connect错误做这个教程当我第一次有:http://facebook.github.io/react-native/docs/tutorial.html#content