unable to load script from sets “index.android.bundle”.make sure your bundle is packaged correctly or you’re running a package server
react-native run-android执行虚拟机红屏
提示:unable to load script from assets’index.android.bundle’.Make sure
your bundle is packaged correctly or your’re running apackager server.
看提示是无法加载资源文件中的script文件,解决办法就是去项目中的android->app->src->main文件夹中新建一个assets文件
然后在项目根目录运行如下代码:
react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/
以上是网上的资料,
其实新版的react-native在根目录下面还缺少一个文件,就是index.android.js文件
解决:复制index.js,更新名字为index.android.js
https://blog.csdn.net/chenrongchun89/article/details/79159104