I am trying to create the native react app by learning some tutorials and using react-native-cli. I am getting this error while running the application on android platform using react-native run-android
script.
The error I am getting is unable to load script from assets index.android.bundle. Make sure your build is packaged correctly and you are running a packager server
.
I tried setting port for TCP. After reading a lot of articles here I found this solution by running the command
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 && react-native run-android
So I added this command in my package.json. Now every time I have to run this command for the changes in code, live refreshing is not working and as I have seen in many tutorial that a development server will start but nothing is starting.
I still didn't understand why this error occurs and why not a JS development server is starting ?
Here is the info of react version - react-native-cli: 2.0.1 react-native: 0.58.6