react-native 遇到的错误
来源:互联网 发布:怎么购买高达模型 知乎 编辑:程序博客网 时间:2024/05/16 10:34
ReferenceError: Can't find variable: __fbBatchedBridge...
react-native启动用来做JavaScript的代码的服务,是本地的服务,App默认访问的host地址是localhost
,运行到真实的设备上面的时候无法访问react-native服务,因此会出现上面的错误。
Android解决方案:
对adb的server设置反向代理
adb reverse tcp:8081 tcp:8081
更改App内的服务地址 * 摇晃手机
* 点击菜单键
* 在电脑上面运行命令
>adb shell input keyevent 82
在dev setting
里面即可设置。
ios解决方案:
在AppDelegate.m
中修改jsCodeLocation
:
`
.....
jsCodeLocation = [NSURL URLWithString:@"http://192.168.31.191:8081/index.ios.bundle?platform=ios&dev=true"];
....
`
react-native start 错误
错误信息:
ERROR: Unknown option --no-prettyERROR: Unknown option --no-prettyWatchman: watchman--no-pretty get-sockname returned with exit code 1 ERROR: Unknown option --no-pretty ERROR watchman--no-pretty get-sockname returned with exit code 1 ERROR: Unknown option --no-prettyError: watchman--no-pretty get-sockname returned with exit code 1 ERROR: Unknown option --no-pretty at ChildProcess.<anonymous> (.../fb-watchman/index.js:198:18) at emitTwo (events.js:106:13) at ChildProcess.emit (events.js:191:7) at maybeClose (internal/child_process.js:852:16) at Socket.<anonymous> (internal/child_process.js:323:11) at emitOne (events.js:96:13) at Socket.emit (events.js:188:7) at Pipe._handle.close [as _onclose] (net.js:492:12)
解决方法:npm
下面的包也有watchman,如果安装了先卸载
npm r -g watchman
重新安装watchman
:
brew uninstall watchman brew link pcre brew install --HEAD watchman
如果出现下面的提示错误:
Error: The `brew link` step did not complete successfullybrew link --overwrite watchman......
直接运行命令:
brew link --overwrite watchman
出现Linking创建的信息:
Linking /usr/local/Cellar/watchman/HEAD-bbd5957... 4 symlinks created
如果出现权限不足的情况,可以运行命令:
sudo chown -R
whoami
/usr/local
阅读全文
0 0
- react-native 遇到的错误
- React-native遇到的错误
- React Native 配置遇到的错误:TransformError
- 运行React Native遇到的一些错误
- react-native遇到过的错误
- React Native 初学之遇到的错误记录
- React Native遇到的问题
- react-native遇到的问题
- React Native遇到的坑
- react-native 打包遇到aapt错误解决方案
- react native常见的错误
- react native常见的错误
- react native常见的错误
- 【React Native】导入github上react native遇到的问题。
- React Native 环境配置遇到的坑
- 安装react-native遇到的问题
- react-native遇到的坑,及解决方法
- React native安装过程遇到的问题
- HDU1723 Distribute Message(dp)
- EditText的输入限制类型
- javaScript中的this
- OpenCV相机标定
- 【更新】Aspose.Pdf 7月新版发布 | 附下载
- react-native 遇到的错误
- hdu-2222 Keywords Search (AC自动机板子题)
- ui-router
- ItemDecoration解析(二) onDraw onDrawOver
- 【概念】WinCE OS 定制时,文件系统是 RAM and ROM file system,还是 ROM-only file system?
- 拼装div
- 使用 Arrays 类操作 Java 中的数组
- 【模板】最小费用最大流
- Python 直接赋值、浅拷贝和深度拷贝解析