問(wèn)題: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
執(zhí)行成功后會(huì)在seests下自動(dòng)生成兩個(gè)文件

備注:上面的命令中indexr.js文件名字要和根目錄下js文件名字相同,RN版本不同創(chuàng)建的首頁(yè)的js文件不同,有的解決方案是輸入android.js

根目錄
附:
React-Native環(huán)境搭建詳細(xì)教程:https://blog.csdn.net/mybook1122/article/details/78562797?locationNum=8&fps=1