开发者问题收集

如何解决 React Native 中出现以下错误

2021-01-02
856

当我尝试使用 react-native run-android 命令运行 react-native 应用程序时,出现以下错误。我在网上搜索过,但找不到此错误的解决方案

    yarn run v1.22.4
    $ react-native run-android
    info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
    Jetifier found 1088 file(s) to forward-jetify. Using 4 workers...
    info Starting JS server...
    info Installing the app...
    
    > Configure project :react-native-reanimated
    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
            at java.net.DualStackPlainSocketImpl.connect0(Native Method)
...
...

如何解决上述问题?

1个回答

我发现了问题。构建工具版本 29.0.2 未安装。我通过 android studio 安装的。现在运行正常。

deluxan
2021-01-02