当我在Android设备上运行react-native
应用程序时,它会在红色屏幕上显示错误:
无法从捆绑“index.android.bundle”
加载脚本
答案 0 :(得分:2)
This following steps helped me resolve the problem in following steps.
If not than (in project directory) 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
答案 1 :(得分:1)
使用npm版本4.3.0 react-native-cli版本2.01 react-native版本0.49.5
在项目目录中,
mkdir android/app/src/main/assets
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
react-native run-android
文件名已从index.android.js更改为index.js