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

后端 未结 30 1989
你的背包
你的背包 2020-11-28 19:16

react-native run-android command terminates by leaving a message in android simulator. The message is as follows:

Unable to load script.Make

30条回答
  •  遥遥无期
    2020-11-28 19:36

    First do steps 4 and 5 then you can run your project. If you do not get the result (with steps 4 and 5) do the following steps

    1- Try to downgrade your Node version (current version is 12.13.1)

      choco uninstall nodejs
      choco install nodejs --version 12.8
    

    2- Add the path of npm module (C:\Users\your user name\AppData\Roaming\npm) to system variables instead of user variables

    3- Install react native globally by using command

      npm install -g react-native-cli
    

    4- Go to the root of your project directory and run the following command :

      react-native start
    

    5- Open another terminal in the root of your project and run the following command :

       react-native run-android 
    

    EDIT :

    You are using Genymotion ? If yes, do the following step :

    After above step if you get the following error ?

    error Failed to launch emulator. Reason: No emulators found as an output of `emulator -list-avds`.
    

    Open your genymotion and go to :

    genymotion menu -> Settings -> ADB -> Then select use custom android sdk tools (click on browse to find sdk location)

    Finally , run you project again ..

提交回复
热议问题