gpt4 book ai didi

android - React-Native 无法获取/和 JS 包

转载 作者:太空狗 更新时间:2023-10-29 14:51:17 24 4
gpt4 key购买 nike

这是我在运行 react-native start 时得到的输出,如您所见,它给出了 404 错误。

我试过在 chrome 中打开该页面,它显示 Cannot GET/

即使通过 wifi 连接设备并输入机器的 IP 地址后,该应用程序也无法在移动设备上运行。它卡在红屏上说 Unable to load JS Bundle.

怎么了?

   C:\Users\Abhishek\Desktop\SpeedRead>react-native start
┌────────────────────────────────────────────────────────────────────────────┐
│ Running packager on port 8081. │
│ │
│ Keep this packager running while developing on any JS projects. Feel │
│ free to close this tab and run your own packager instance if you │
│ prefer. │
│ │
│ https://github.com/facebook/react-native │
│ │
└────────────────────────────────────────────────────────────────────────────┘
Looking for JS files in
C:\Users\Abhishek\Desktop\SpeedRead

[3:25:35 PM] <START> Building Dependency Graph
[3:25:35 PM] <START> Crawling File System
[3:25:35 PM] <START> Loading bundles layout
[3:25:35 PM] <END> Loading bundles layout (0ms)

React packager ready.

[3:25:44 PM] <END> Crawling File System (9096ms)
[3:25:44 PM] <START> Building in-memory fs for JavaScript
[3:25:45 PM] <END> Building in-memory fs for JavaScript (554ms)
[3:25:45 PM] <START> Building in-memory fs for Assets
[3:25:45 PM] <END> Building in-memory fs for Assets (521ms)
[3:25:45 PM] <START> Building Haste Map
[3:25:46 PM] <START> Building (deprecated) Asset Map
[3:25:46 PM] <END> Building (deprecated) Asset Map (95ms)
[3:25:49 PM] <END> Building Haste Map (3482ms)
[3:25:49 PM] <END> Building Dependency Graph (13858ms)
::1 - - [31/Jan/2016:09:56:19 +0000] "GET / HTTP/1.1" 404 13 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.97 Safari/537.36"
::1 - - [31/Jan/2016:09:56:19 +0000] "GET /favicon.ico HTTP/1.1" 404 24 "http://localhost:8081/" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.97 Safari/537.36"

我看到的问题:

react native android failed to load JS bundle

但它不起作用。

最佳答案

如果您想确保打包程序正在加载,您需要导航到 http://localhost:8081/js/index.android.bundle?platform=android。如果您仍然收到 404,则很可能是您的网络配置有问题。

如果您可以在网络上找到它,请通过 USB adb reverse tcp:8081 tcp:8081 插入手机运行它。

关于android - React-Native 无法获取/和 JS 包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35112546/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com