實(shí)行命令react-native run-android報(bào)以下錯(cuò)誤
unable to load script from assets 'index.android bundle' ,make sure your bundle is packaged correctly or youu're runing a packager server
1.先在工作目錄創(chuàng)建:android/app/src/main 目錄下創(chuàng)建一個(gè) assets空文件夾
2.如果react-native是之前版本撑毛,目錄下有index.android.js,那么在命令行代碼執(zhí)行以下命令
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/
2.如果react-native是新版本愿棋,目錄下有index.js和App.js那么在命令行代碼執(zhí)行以下命令
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/
3.再實(shí)行react-native run-android命令即可