React-Native - 无法连接到开发服务器(iOS模拟器)

时间:2016-09-06 22:09:24

标签: react-native

Error:

Could not connect to develpment server.

Ensure the following:
- Node server is running and available on the same network - run 'npm start' from react-native root
- Node server URL is correctly set in AppDelegate

URL: http://127.0.0.1:8081/index.ios.bundle?platform=ios&dev=true

我肯定是在运行npm start。为什么不运行?

现在我看到了这个错误:

In file included from /Users/*******/f8app/node_modules/react-native-fbsdk/ios/RCTFBSDK/core/RCTFBSDKAccessToken.m:19:
/Users/*********/f8app/node_modules/react-native-fbsdk/ios/RCTFBSDK/core/RCTFBSDKAccessToken.h:21:9: fatal error: 
      'FBSDKCoreKit/FBSDKCoreKit.h' file not found
#import <FBSDKCoreKit/FBSDKCoreKit.h>

2 个答案:

答案 0 :(得分:0)

项目是否在Xcode中成功?

您是否仔细检查了facebook提到的这些步骤:

  • 确保安装了Facebook SDK框架 〜/文档/ FacebookSDK。
  • 确保FBSDK [Core,Login,Share] Kit.framework出现在 链接Binary与构建目标的Build的Libraries部分 相。
  • 确保〜/ Documents / FacebookSDK在Framework Search中 构建目标的构建设置的路径。 (https://github.com/facebook/react-native-fbsdk

我自己在最后一步遇到了一些麻烦,但在一个新项目重试后一切正常

Example image from web showing the correct search path

答案 1 :(得分:0)

如果项目构建没有成功,您可能想尝试这个。 您应该首先更新现有的FBSDK(如果有的话)

https://medium.com/@alberto.schiabel/react-native-on-xcode-beta-8-0-how-to-fix-initial-build-error-f0225c649850#.439zl5504