Unable to load script from assets index.android.bundle on windows

后端 未结 30 4083
鱼传尺愫
鱼传尺愫 2020-11-22 06:33

I\'m trying to run my first React Native project for first time on my device (Android 4.2.2).

And I get:

unable to load script from assets in

30条回答
  •  余生分开走
    2020-11-22 06:49

    If when running react-native run-android command the second line of the trace is

    JS server not recognized, continuing with build...
    

    it means packager for the app cannot be started and the app will fail to load without some extra steps. Note that the end of the trace still reports success:

    BUILD SUCCESSFUL
    

    The problem is probably some port conflict (in my case it was the default IIS site that I completely forgot about). Another manifestation of the problem would be a failure to open http://localhost:8081/debugger-ui URL in Chrome.

    Once the port conflict is resolved the trace will report

    Starting JS server...
    

    then an additional Node window will open (node ...cli.js start) and the app will load/reload successfully.

    After that you should be able to open debug console in Chrome with http://localhost:8081/debugger-ui.

提交回复
热议问题