React Native iOS 之Could not connect to development server.
2016-02-16 17:16
671 查看
React Native iOS 之Could not connect to development server.
React Native 是目前最火的开发框架,其他不说了,上Bug。
按照 React Native iOS环境搭建
高级版
在mac上 搭建 React Native 环境,运行 项目 若出现了如下情况。
模拟器上 显示
Xcode 打印
2016-02-16 17:01:49.806 [info][tid:com.facebook.React.JavaScript][RCTJSCProfiler.m:63] JSC profiler is not supported.
2016-02-16 17:01:50.089 [fatal][tid:main] Could not connect to development 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://localhost:8081/index.ios.bundle?platform=ios&dev=true
请将项目中 AppDelegate.m 中的
替换为
原因之一:做本地局域网开发环境,大部分都会做服务器映射处理,localhost 被指向特定的IP 而不是本机的127.0.0.1, 就会出现这样的问题。
React Native 是目前最火的开发框架,其他不说了,上Bug。
按照 React Native iOS环境搭建
高级版
在mac上 搭建 React Native 环境,运行 项目 若出现了如下情况。
模拟器上 显示
Xcode 打印
2016-02-16 17:01:49.806 [info][tid:com.facebook.React.JavaScript][RCTJSCProfiler.m:63] JSC profiler is not supported.
2016-02-16 17:01:50.089 [fatal][tid:main] Could not connect to development 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://localhost:8081/index.ios.bundle?platform=ios&dev=true
请将项目中 AppDelegate.m 中的
jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"];
替换为
jsCodeLocation = [NSURL URLWithString:@"http://127.0.0.1:8081/index.ios.bundle?platform=ios&dev=true"];
原因之一:做本地局域网开发环境,大部分都会做服务器映射处理,localhost 被指向特定的IP 而不是本机的127.0.0.1, 就会出现这样的问题。
相关文章推荐
- 通往全栈工程师的捷径 —— react
- React Native生命周期
- react-native学习(二)
- Netty与Reactor模式
- React native 学习
- React-native初体验之一个完整的Flexbox指南
- React基础笔记
- 【React Native开发】React Native控件之RefreshControl组件详解(21)
- React 【ES2015】+ Babel + Gulp + Webpack
- react-native启动异常,react-deep-force-update/.babelrc
- react-native启动异常,react-deep-force-update/.babelrc
- react-native for android 学习笔记 (1) DrawerLayoutAndroid
- React 入门实例教程
- React Native的开发工具和调试方法
- React Native入门——组件构成及生命周期简介
- ReactJS 入门实例学习
- React Native学习之自定义一个组件
- React Native iOS环境搭建 高级版
- react native Unable to download JS bundle 的解决方案
- React-Native 学习之--问题处理 一. github上下载的项目不能运行?