2

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-androidscript. 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.

enter image description hereenter image description here

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

Hardik Virani
  • 1,687
  • 7
  • 23
  • 36
s_k_t
  • 689
  • 1
  • 15
  • 36
  • Possible duplicate of [Unable to load script from assets index.android.bundle on windows](https://stackoverflow.com/questions/44446523/unable-to-load-script-from-assets-index-android-bundle-on-windows) – Martin Zeitler Mar 04 '19 at 02:24
  • But my development server is not working and I can't resist myself to re run this script on every changes.If anyone found any solution and explain why the development server is not opening when running the command to live watch the changes. – s_k_t Mar 04 '19 at 02:28
  • also duplicate: https://stackoverflow.com/questions/47341120/js-server-not-recognized-continuing-with-build (`:8081` might be in use). – Martin Zeitler Mar 04 '19 at 02:34
  • try command in project root directory `react-native start` and then run – Hardik Virani Mar 04 '19 at 06:11

0 Answers0