我正在尝试运行我的第一个React Native项目,但是出现了错误:
"Couldn't get batched bridge, make sure your package is bundled correctly"
请帮助我解决这个问题 - 我正在使用Windows机器。
我正在尝试运行我的第一个React Native项目,但是出现了错误:
"Couldn't get batched bridge, make sure your package is bundled correctly"
请帮助我解决这个问题 - 我正在使用Windows机器。
我遇到了同样的问题。按照以下步骤解决您项目文件夹中的问题:
react-native start
可能需要一些时间。输出结果将会是这样的:
Scanning 581 folders for symlinks in /home/shantanu/react-native/AwesomeProject/node_modules (5ms)
┌────────────────────────────────────────────────────────────────────────────┐
│ 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
/home/shantanu/react-native/AwesomeProject
[10/3/2016, 12:49:34 PM] <START> Building Dependency Graph
[10/3/2016, 12:49:34 PM] <START> Crawling File System
[Hot Module Replacement] Server listening on /hot
React packager ready.
[10/3/2016, 12:49:47 PM] <END> Crawling File System (12440ms)
[10/3/2016, 12:49:47 PM] <START> Building in-memory fs for JavaScript
[10/3/2016, 12:49:47 PM] <END> Building in-memory fs for JavaScript (123ms)
[10/3/2016, 12:49:47 PM] <START> Building in-memory fs for Assets
[10/3/2016, 12:49:47 PM] <END> Building in-memory fs for Assets (90ms)
[10/3/2016, 12:49:47 PM] <START> Building Haste Map
[10/3/2016, 12:49:47 PM] <START> Building (deprecated) Asset Map
[10/3/2016, 12:49:47 PM] <END> Building (deprecated) Asset Map (38ms)
[10/3/2016, 12:49:47 PM] <END> Building Haste Map (773ms)
[10/3/2016, 12:49:47 PM] <END> Building Dependency Graph (13551ms)
^[[B
[10/3/2016, 12:50:35 PM] <START> Requesting bundle: {"url":"/index.android.bundle?platform=android&dev=true&hot=false&minify=false"}
[10/3/2016, 12:50:35 PM] <START> Finding dependencies
transformed 636/636 (100%)
[10/3/2016, 12:50:45 PM] <END> Finding dependencies (9503ms)
[10/3/2016, 12:50:48 PM] <END> Requesting bundle: {"url":"/index.android.bundle?platform=android&dev=true&hot=false&minify=false"} (13130ms)
完成后运行以下代码:
react-native run-android
react-native start
,它对我来说是无法工作的。 - thepanuto在我的Windows机器上,当我按照入门教程并使用Visual Studio模拟器进行Android开发时,遇到了同样的问题。
后来发现是因为构建应用程序时找不到adb而导致失败,所以我通过将Android SDK平台工具文件夹添加到我的PATH中来解决这个问题。请检查您是否已经添加了它! :)
我曾经遇到过同样的问题-
解决方法:
1. 在 Android 设备上打开应用程序。
2. 摇晃它(重新加载)
3. 然后,在菜单上点击 dev settings
4. 然后点击 Debug server host & port for device
5. 输入您计算机的 IP 地址,后跟端口号(通常为 8081)。例如:192.168.0.3:8081
6. 重新加载。 大功告成!
$ adb reverse tcp:8081 tcp:8081
针对Mac用户:--
1. Go to Library/Android/sdk/platform-tools
2. ./adb reverse tcp:8081 tcp:8081
对于Windows用户:
1. Go to C:\Users\<username>\AppData\Local\Android\sdk\platform-tools
2. adb reverse tcp:8081 tcp:8081
adb reverse tcp:8081 tcp:8081
了吗? - Samuli Hakoniemi