unable to load script from assets ‘index.android bundle’ ,make sure your bundle is packaged correctl

在Android Studio中启动React Native项目是报一下错误:

unable to load script from assets ‘index.android bundle’ ,make sure your bundle is packaged correctly or youu’re runing a packager server

解决办法:

cmd打开命令行工具:

1,在 android/app/src/main 目录下创建一个 assets空文件夹

mkdir android/app/src/main/assets
  • 1

2,在项目根目录运行

react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/s
重新部署项目即可

猜你喜欢

转载自blog.csdn.net/qq_36428821/article/details/80224384