简体   繁体   中英

Unable to download JS bundle error in android react native

I'm working on React Native on Windows and I have a problem on my device (Android 4.1.2). I am following the tutorial but, i have a problem when i run on my device then it shows red screen with error message "Unable to download JS bundle"

My question is about the second part : when i Configure device to connect to the dev server via Wi-Fi. When I go to "developer options", to write my machine's IP address then app is crash

How can I try to resolve this error ?

  1. To run with local server, run the following commands under your react-native project root directory react-native start > /dev/null 2>&1 &
  2. Make sure your laptop and your phone are on the same Wi-Fi network.
  3. Open your React Native app on your device.
  4. You'll see a red screen with an error. This is OK. We'll fix this in the following steps.
  5. Open the Developer menu by shaking the device or running adb shell input keyevent 82 from the command line.
  6. Go to Dev Settings.
  7. Go to Debug server host for device.
  8. Type in your machine's IP address and the port of the local dev server (eg 10.0.1.1:8081). On Mac, you can find the IP address in System Preferences / Network. On Windows, open the command prompt and type ipconfig to find your machine's IP address (more info).
  9. Go back to the Developer menu and select Reload JS.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM