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

Starting a React Native project in Android Studio is to report an error:

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

Solution:

cmd opens the command line tool:

1. Create an empty asset folder in the android/app/src/main directory

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

2. Run in the project root directory

react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/s
Just redeploy the project

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325688598&siteId=291194637