【问题标题】:Connect to 192.168.0.1:8080 [/192.168.0.1] failed: Connection timed out: connect in node js when resolving com.android.tools.build:gradle:3.1.4连接到 192.168.0.1:8080 [/192.168.0.1] 失败:连接超时:解析 com.android.tools.build:gradle:3.1.4 时在节点 js 中连接
【发布时间】:2019-05-18 17:44:43
【问题描述】:

您好,我正在尝试在 react native 中运行应用程序,但是在加载依赖项时,即 com.android.tools.build:gradle:3.1.4。我收到一条错误消息:

FAILURE:构建失败并出现异常。

我的 build.gradle 类已配置为大多数解决方案提供的内容

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext {
        buildToolsVersion = "27.0.3"
        minSdkVersion = 16
        compileSdkVersion = 27
        targetSdkVersion = 26
        supportLibVersion = "27.1.1"
    }
    repositories {
        jcenter()
        google()

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.4'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        mavenLocal()
        google()
        jcenter()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }
    }
}


task wrapper(type: Wrapper) {
    gradleVersion = '4.4'
    distributionUrl = distributionUrl.replace("bin", "all")
}

但我仍然无法找到加载 com.android.tools.build:gradle:3.1.4 的解决方案。 我不知道错误是否源于 连接到 192.168.0.1:8080 [/192.168.0.1] 失败:连接超时:连接部分。 任何有解决方案的人请帮忙。

【问题讨论】:

    标签: android node.js react-native


    【解决方案1】:

    我终于找到了解决办法。此错误来自代理。显然我已经安装了使用代理服务器的先前设置的 gradle。为了解决这个问题。转到本地 gradle 安装 ie for windows C:/users/用户名/.gradle 搜索 settings.gradle 并删除所有代理 或更改为您正在使用的代理。

    【讨论】:

      猜你喜欢
      • 2021-10-22
      • 2012-05-31
      • 1970-01-01
      • 1970-01-01
      • 2014-11-11
      • 1970-01-01
      • 1970-01-01
      • 2018-07-07
      • 1970-01-01
      相关资源
      最近更新 更多