Unable to load script react native metro server


Unable to load script react native metro server

  • Create assets folder inside the project directory: \android\app\src\main

    Or you can run the command  to create the assets directory:
    mkdir android / app / src / main / assets

  • Switch to the project directory. example cd MyProject
    then run a 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

  • Finally run a command:
    react-native run-android
Optionaly, you can automate the above processes by adding the code into the script part of package.json package.
  • “Android-Window”: “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

Your application will not report the above error anymore. Thank you!