【发布时间】:2021-12-19 23:53:22
【问题描述】:
我无法在 vs 代码上启动 android 模拟器来运行 react-native。我已经在 android studio 中有一个模拟器。它显示
error Failed to launch emulator. Reason: No emulators found as an output of `emulator -list-avds`.
作为 react-native 的新手,我不知道该怎么做。
Metro bundler 运行良好,但是当输入npx react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 870 file(s) to forward-jetify. Using 4 workers...
info Starting JS server...
info Installing the app...
Starting a Gradle Daemon (subsequent builds will be faster)
IOException: https://dl.google.com/android/repository/addons_list-3.xml
java.net.ConnectException: Connection refused: connect
IOException: https://dl.google.com/android/repository/addons_list-2.xml
java.net.ConnectException: Connection refused: connect
IOException: https://dl.google.com/android/repository/addons_list-1.xml
java.net.ConnectException: Connection refused: connect
Failed to download any source lists!
IO exception while downloading manifest:
java.net.ConnectException: Connection refused: connect
【问题讨论】:
-
您能否向我们解释一下您到目前为止已经完成了哪些步骤?请查看此文档reactnative.dev/docs/running-on-device。并确保您的地铁捆绑器正在您的终端上运行,否则请点击
react-native start -
我刚刚创建了项目并尝试运行它。Metro Bundler 也显示错误
Failed to construct transformer: Error: error:0308010C:digital envelope routines::unsupported -
通过该链接,我解决了 Metro 捆绑器中的错误。所以 Metro bundler 运行良好。剩下的问题是模拟器没有运行......
-
运行
react-native run-android时的错误是error Failed to launch emulator. Reason: No emulators found as an output ofemulator -list-avds.`
标签: javascript android node.js react-native android-emulator