React-Native 错误集
2018-11-07 本文已影响0人
小的小碰撞
常用命令
watchman watch-del-all
rm -rf node-modules && npm install
React Native 'config.h' file not found
- cd 项目根目录下
cd node_modules/react-native/third-party/glog-0.3.5
../../scripts/ios-configure-glog.sh
- 注意:
glog-0.3.5
可以改变
缺少 node_modules/react-native/Libraries/WebSocket/libfishhook.a' xcode
报错
image.png
Failed to load bundle(http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false) with error:(Unable to resolve module react-native/Libraries/StyleSheet/normalizeColor
from /Volumes/WORK/react-native-app/node_modules/antd-mobile-rn/lib/segmented-control/segmented.android.js
: Module react-native/Libraries/StyleSheet/normalizeColor
does not exist in the Haste module map
- 解决
yarn add normalize-css-color -D
React-native no bundle URL present
- 修改代理模式为自动
- npm install
- react-native run-ios
React Native出错:Application XXX has not been registered解决方案
image.png-
.可能先前运行过其他ReactNative项目,此时退出终端程序,重新运行即可。
-
2.设置项目名称在AppDelegate.m和index.ios.js中不一致,或者在主业务逻辑页面中的名称不一致,如下图所示。找到问题更换即可。
AppRegistry.registerComponent('PicShow', () => App);
'React/RCTBundleURLProvider.h' file not found
image.png新建RN项目时在iOS端用xcode跑时有时会遇到 'React/RCTBundleURLProvider.h' file not found 错误,遇到这种错误一般有一下几种情况:
- 没有执行 npm install 命令,没有安装依赖,此时执行 npm install 安装依赖即可.
- 依赖已经安装,但还是会报这个错,此时将项目下node_modules文件夹删除,再次执行 npm install 命令安装依赖即可.