close

[Solved] Unable to load script.Make sure you are either running a Metro server or that your bundle ‘index.android.bundle’ is packaged correctly for release

Hello Guys, How are you all? Hope You all Are Fine. Today I am trying to run my react-native app But I am facing following error Unable to load script.Make sure you are either running a Metro server or that your bundle ‘index.android.bundle’ is packaged correctly for release in React-native. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How Unable to load script.Make sure you are either running a Metro server or that your bundle ‘index.android.bundle’ is packaged correctly for release Error Occurs ?

I am trying to run my react-native app But I am facing following error.

Unable to load script.Make sure you are either running a Metro server or that your bundle 'index.android.bundle' is packaged correctly for release.

How To Solve Unable to load script.Make sure you are either running a Metro server or that your bundle ‘index.android.bundle’ is packaged correctly for release Error ?

  1. How To Solve Unable to load script.Make sure you are either running a Metro server or that your bundle ‘index.android.bundle’ is packaged correctly for release Error ?

    To Solve Unable to load script.Make sure you are either running a Metro server or that your bundle ‘index.android.bundle’ is packaged correctly for release Error First of all You need to make This Directory: android/app/src/main/assets And then Go To root of your project and Then Change Your index.android.js name to index.js
    Then Just run this 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 Now, You can run react-native run-android Now, Your error must be solved.

  2. Unable to load script.Make sure you are either running a Metro server or that your bundle ‘index.android.bundle’ is packaged correctly for release

    To Solve Unable to load script.Make sure you are either running a Metro server or that your bundle ‘index.android.bundle’ is packaged correctly for release Error You Need to start npm first before you run react-native run-android so that First of all run this command in root directory of your project: npm start OR react-native start Then Run this command: react-native run-android Now, Your error must be solved.

Solution 1: Run npm start

You Need to start npm first before you run react-native run-android so that First of all run this command in root directory of your project.

npm start

OR

react-native start

Then Run this command.

react-native run-android

Now, Your error must be solved.

Solution 2: Use index.js

  1. First of all You need to make This Directory: android/app/src/main/assets
  2. And then Go To root of your project and Then Change Your index.android.js name to index.js
  3. Then Just run this command.
  4. 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
  5. Now, You can run react-native run-android
  6. Now, Your error must be solved.

Summary

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?

Also, Read

Leave a Comment