首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法解决org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.10

无法解决org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.10
EN

Stack Overflow用户
提问于 2020-10-09 10:21:35
回答 2查看 5.9K关注 0票数 8

我对Android程序很陌生,但并不是什么新鲜事。到目前为止,我一直在iOS上进行测试。现在,当我想在Android上进行测试时,我遇到了以下问题:

代码语言:javascript
复制
FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all artifacts for configuration ':classpath'.
   > Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.10.
     Required by:
         project :
      > Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.10.
         > Could not get resource 'https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.4.10/kotlin-gradle-plugin-1.4.10.pom'.
            > Could not GET 'https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.4.10/kotlin-gradle-plugin-1.4.10.pom'.
               > Connect to 127.0.0.1:1088 [/127.0.0.1] failed: Connection refused (Connection refused)
      > Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.10.
         > Could not get resource 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-gradle-plugin/1.4.10/kotlin-gradle-plugin-1.4.10.pom'.
            > Could not GET 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-gradle-plugin/1.4.10/kotlin-gradle-plugin-1.4.10.pom'.
               > Connect to 127.0.0.1:1088 [/127.0.0.1] failed: Connection refused (Connection refused)
   > Could not resolve com.google.gms:google-services:4.3.3.
     Required by:
         project :
      > Could not resolve com.google.gms:google-services:4.3.3.
         > Could not get resource 'https://dl.google.com/dl/android/maven2/com/google/gms/google-services/4.3.3/google-services-4.3.3.pom'.
            > Could not GET 'https://dl.google.com/dl/android/maven2/com/google/gms/google-services/4.3.3/google-services-4.3.3.pom'.
               > Connect to 127.0.0.1:1088 [/127.0.0.1] failed: Connection refused (Connection refused)
      > Could not resolve com.google.gms:google-services:4.3.3.
         > Could not get resource 'https://jcenter.bintray.com/com/google/gms/google-services/4.3.3/google-services-4.3.3.pom'.
            > Could not GET 'https://jcenter.bintray.com/com/google/gms/google-services/4.3.3/google-services-4.3.3.pom'.
               > Connect to 127.0.0.1:1088 [/127.0.0.1] failed: Connection refused (Connection refused)

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 6s
Exception: Gradle task assembleDebug failed with exit code 1

这是我的android/build.gradle

代码语言:javascript
复制
buildscript {
    ext.kotlin_version = '1.4.10'
    repositories {
        google()  // Google's Maven repository
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:4.0.1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'com.google.gms:google-services:4.3.3'
    }
}

allprojects {
    repositories {
        google()  // Google's Maven repository
        jcenter()
    }
}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

由于我对android及其问题不太熟悉,请告诉我在这个问题中还有什么需要补充的。

谢谢

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2020-10-09 11:56:18

脚本中的所有依赖项请求最终都会出现相同的错误。

连接到127.0.0.1:1088 /127.0.0.1失败:连接被拒绝(连接被拒绝)

可能是这样的,您已经将系统配置为使用本地代理服务器,但它实际上并不在1088端口上运行。

票数 2
EN

Stack Overflow用户

发布于 2021-05-21 10:58:09

由于Jcenter()现在已在2021年进行了实践,您可以将mavencentral添加到Project中

代码语言:javascript
复制
repositories {
        google()
        mavenCentral()
    }
票数 13
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64278139

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档