当我在Android设备上运行 react-native 应用程序时,它在红色屏幕上显示错误:
react-native
无法从bundle“index.android.bundle”加载脚本
以下步骤帮助我解决了以下步骤中的问题 .
如果不是(在项目目录中)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
使用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
文件名已从index.android.js更改为index.js
2 回答
以下步骤帮助我解决了以下步骤中的问题 .
如果不是(在项目目录中)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
使用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