大神们,请留步,新手求助:运行run-android 后 虚拟设备红屏错误 Unable to load script..Make sure you're either running a Metro server(run 'react-native start) or that your bundle 'index.android.bundle' is packaged correctly for release



  • Unable to load script.Make sure you're either running a Metro server(run 'react-native start) or that your bundle 'index.android.bundle' is packaged correctly for release.0_1557311827002_bdde14c5-07ed-481f-bad0-88bb8ed88a36-image.png
    事实上 我的Metro 已经正确running
    0_1557312395835_4b1a8bb5-dd8b-4b92-8ba9-aa4d05f3a28f-image.png



  • google 后运行了下面的命令 好用了

    $ mkdir 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 run-android
    虽然中文网教程 告诉千万不要执行 bundle 命令 可是不执行一直报这个红屏错误 。
    0_1557313071317_c99767ca-7d13-4240-b8a1-2a4f3785264d-image.png

    命令执行后好了



  • 执行bundle命令后就不能刷新了
    metro在运行但并没有连接上,按下面这篇文档检查操作
    https://reactnative.cn/docs/running-on-device/


Log in to reply