react-native 啟動的時候報錯unable to load script from assets 'index.android bundle'
阿新 • • 發佈:2018-12-16
實行命令react-native run-android報以下錯誤
unable to load script from assets 'index.android bundle' ,make sure your bundle is packaged correctly or youu're runing a packager server
1.先在工作目錄建立:android/app/src/main 目錄下建立一個 assets空資料夾
2.如果react-native是之前版本,目錄下有index.android.js,那麼在命令列程式碼執行以下命令
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 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/