java.lang.RuntimeException: Unable to load script from assets ‘index.android.bundle‘.

  • Post author:
  • Post category:java


java.lang.RuntimeException: Unable to load script from assets ‘index.android.bundle’. Make sure your bundle is packaged correctly or you’re running a packager server.

  1. 在工程目录创建assets文件 mkdir android/app/src/main/assets
  2. 运行命令     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