react-native 环境搭建 遇到的坑

问题:Cannot find entry file index.android.js in any of the roots

解决方案:

1.在android\app\src\main目录下新建assets文件夹

2.在命令行输入:

react-native bundle –platform android –dev false –entry-file index.js –bundle-output android/app/src/main/assets/index.android.bundle –assets-dest android/app/src/main/res

执行成功后会在seests下自动生成两个文件

《react-native 环境搭建 遇到的坑》

备注:上面的命令中indexr.js文件名字要和根目录下js文件名字相同,RN版本不同创建的首页的js文件不同,有的解决方案是输入android.js

《react-native 环境搭建 遇到的坑》 根目录

附:

React-Native环境搭建详细教程:https://blog.csdn.net/mybook1122/article/details/78562797?locationNum=8&fps=1

    原文作者:Super面包
    原文地址: https://www.jianshu.com/p/1bbea00d2853
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞