常见问题及解决办法

问题: Packager can't listen on port 8081
办法:
Most likely another process is already using this port
Run the following command to find out which process:
   lsof -i :8081 
Then, you can either shut down the other process:
   kill -9 <PID> 
or run packager on different port.
问题:undefined is not object (evaluating 'ViewPropTypes.style')
办法:
run
npm uninstall react-native-scrollable-tab-view
run
npm install react-native-scrollable-tab-view@0.6.0
run
npm uninstall react-native-vector-icons
delete ( not necessary, it will be deleted automatically)
"react-native-vector-icons": "XXX"" in file "package.json"
run
npm install react-native-vector-icons
run
react-native link react-native-vector-icons
run
react-native run-ios
问题:npm install react-native-vector-icons  安装时报错:registry error parsing json
办法:npm config set registry "http://registry.npmjs.org/"
问题:unrecognized font family 'lonicons'
办法:将项目里node_modules/react-native-vector-icons/fonts里的字体放入xcode工程里,重新运行即可
问题:Build failing after updating to RN 0.4 - Redefinition of RCTLogLevel #375
办法:
I fixed this issue like this
if 'react-native' version >=0.40 then we should update 'react-native-vector-icons' version to 4.0.
Update using the following command

npm install --save react-native-vector-icons@4.0
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容