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

后端 未结 30 4132
鱼传尺愫
鱼传尺愫 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 07:07

    I was also facing this problem because when I run projects on the emulator its working fine but on a real device it gives this error. So I resolve this problem by the following solution

    1st step: First of all open cmd and go to your SDK manager Platform-tools folder

    cd C:Development\Android\Sdk\Platform-tools
    

    2nd step: now run this command :

    adb devices
    

    after this command check your device listed in command prompt

    3rd step: now run this

    adb reverse tcp:8081 tcp:8081
    

    Now your setup is done

    4th step: Go to your project directory and run this command

    react-native run-android
    

提交回复
热议问题