reactnative 单纯适用的填坑

前几个月刚开始看ReactNative时候 碰到小白痴问题 之前记录在markdown里 在这里重写记一下吧 毕竟小白痴应该是一代接一代的

一些填坑记录

标签: 入坑总结

简书地址:http://www.jianshu.com/u/e2c97b29a17d


别人的

http://vanessa.b3log.org/articles/2017/06/12/1497235254333.html


问题一

RN嵌入原生项目 启动服务react-native start ,问题 ERROR Packager can't listen on port 8081解决


嵌入到原生项目 启动服务

react-native start

问题

ERROR Packager can't listen on port 8081

解决方法
1.查看当前使用该端口的进程

lsof -n -i4TCP:8081

2.杀掉

 kill -9 <PID>

或者粗暴的直接手动关闭所有终端
3.重新启动

问题二


[!] No podspec found for Yoga in ../node_modules/react-native/ReactCommon/yoga

next

Specs satisfying the Yoga (from./ReactComponent/node_modules/react-native/ReactCommon/yoga) dependency were found, but they required a higher minimum deployment target.

next

podfile 中修改 (原来是7.0)
platform:ios, ‘8.0’

DONE!


问题三

编译iOS项目出现问题

native module cannot be null

解决
podflie中少链接了两个库

'RCTWebSocket',
'RCTLinkingIOS',


问题四

ReactNative报出 'React/RCTBundleURLProvider.h' file not found错误
执行

yarn link

或者试试 Always Search User Paths -> 将 Always Search User Paths 设置为 Yes -> Clean -> Build


问题五

  • boost/static_assert.hpp not found

解决:https://github.com/facebook/react-native/issues/14404


问题六

  • JavaScriptCore/JavaScriptCore.h not found

*解决: In case you get the same error, you now have to add BatchedBridge in the React subspecs list in your Podfile.


问题七

  • maximum call stack size exceeded
    原因:render里 setstate 无限循环
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

友情链接更多精彩内容