简体   繁体   English

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

[英]Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.10

I'm new to Android programming but not so new to Flutter. So far I have been testing on iOS. Now when I want to test on Android I got this problem:我是 Android 编程的新手,但不是 Flutter 的新手。到目前为止,我一直在测试 iOS。现在,当我想测试 Android 时,我遇到了这个问题:

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

Here is my android/build.gradle :这是我的android/build.gradle

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
}

Since I'm not very familiar with android and its problems, please let me know if there is anything else I need to include here in this question.由于我对 android 及其问题不是很熟悉,如果我需要在此问题中包含任何其他内容,请告诉我。

Thank you谢谢

As the Jcenter() is depracated now in 2021, You can add the mavencentral in Project Level Gradle as由于 Jcenter() 现在已于 2021 年弃用,您可以在项目级别 Gradle 中添加 mavencentral 作为

repositories {
        google()
        mavenCentral()
    }

All dependency requests in your script end up with the same error脚本中的所有依赖项请求最终都会出现相同的错误

Connect to 127.0.0.1:1088 [/127.0.0.1] failed: Connection refused (Connection refused)连接到 127.0.0.1:1088 [/127.0.0.1] 失败:连接被拒绝(Connection refused)

It may be the case that you have configured your system to use a local proxy server, but it's not actually running on that 1088 port.可能是您已将系统配置为使用本地代理服务器,但它实际上并未在该 1088 端口上运行。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 react-native-webview 无法解析 org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.11 - react-native-webview Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.11 Android - 无法解析 org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.0 - Android - Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.0 Android Studio 无法解析 org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10 - Android Studio could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10 没有 org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.21 的缓存版本可用于离线模式错误 - No cached version of org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.21 available for offline mode Error IONIC ISSUE无法解析org.jetbrains.kotlin:kotlin-stdlib:1.1.3-2 - IONIC ISSUE Could not resolve org.jetbrains.kotlin:kotlin-stdlib:1.1.3-2 无法解决:org.jetbrains.kotlin:kotlin-stdlib - Failed to resolve: org.jetbrains.kotlin:kotlin-stdlib Gradle 构建失败:找不到 org.jetbrains.kotlin 即使我没有使用 Kotlin - Gradle build failed : could not find org.jetbrains.kotlin even if I haven't used Kotlin Gradle 同步失败:找不到 org.jetbrains.kotlin(无意使用 Kotlin) - Gradle sync failed: Could not find org.jetbrains.kotlin (no intention to use Kotlin) 找不到 kotlin-gradle-plugin - Could not find kotlin-gradle-plugin Kotlin 错误:找不到 org.jetbrains.kotlin:kotlin-stdlib-jre7:1.0.7 - Kotlin Error : Could not find org.jetbrains.kotlin:kotlin-stdlib-jre7:1.0.7
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM