简体   繁体   English

Flutter:“无法解析配置':classpath'的所有工件”

[英]Flutter: "Could not resolve all artifacts for configuration ':classpath'"

I am trying to run a default flutter app but when I run it gives the below error:我正在尝试运行默认的颤振应用程序,但是当我运行它时会出现以下错误:

Running Gradle task 'assembleDebug'...

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 com.android.tools.build:gradle:3.5.3.
     Required by:
         project :
      > Could not resolve com.android.tools.build:gradle:3.5.3.
         > Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.5.3/gradle-3.5.3.pom'.
            > Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.5.3/gradle-3.5.3.pom'.
               > Connect to 172.30.0.15:3128 [/172.30.0.15] failed: Connection timed out: connect
      > Could not resolve com.android.tools.build:gradle:3.5.3.
         > Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.5.3/gradle-3.5.3.pom'.
            > Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.5.3/gradle-3.5.3.pom'.
               > Connect to 172.30.0.15:3128 [/172.30.0.15] failed: Connection timed out: connect
   > Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.50.
     Required by:
         project :
      > Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.50.
         > Could not get resource 'https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.3.50/kotlin-gradle-plugin-1.3.50.pom'.
            > Could not GET 'https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.3.50/kotlin-gradle-plugin-1.3.50.pom'.
               > Connect to 172.30.0.15:3128 [/172.30.0.15] failed: Connection timed out: connect
      > Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.50.
         > Could not get resource 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-gradle-plugin/1.3.50/kotlin-gradle-plugin-1.3.50.pom'.
            > Could not GET 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-gradle-plugin/1.3.50/kotlin-gradle-plugin-1.3.50.pom'.
               > Connect to 172.30.0.15:3128 [/172.30.0.15] failed: Connection timed out: connect

* 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 2m 25s
Exception: Gradle task assembleDebug failed with exit code 1

below is the build.gradle code:下面是 build.gradle 代码:

buildscript {
    ext.kotlin_version = '1.3.50'
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.3'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

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

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

The whole code of the app is default one, no changes have been done I have just connected an emulator and tried to run if it works and am stuuck at this assembleDebug error.该应用程序的整个代码是默认代码,没有进行任何更改我刚刚连接了一个仿真器并尝试运行它是否可以运行并且我陷入了这个 assembleDebug 错误。 If anyone has any idea where Im going wrong please do comment...如果有人知道我哪里出错了,请发表评论...

One of the important CLI command in Flutter is flutter doctor . Flutter 中重要的 CLI 命令之一是flutter doctor This command will check the current status of the flutter information.该命令将检查颤振信息的当前状态。 If some software is missing or not working then it will show a warning.如果某些软件丢失或无法运行,则会显示警告。

Check the documentation for an example (this is for Windows OS setup).查看文档以获取示例(这是针对Windows 操作系统设置的)。

See also macOS setup, Linux and Chrome OS .另请参阅macOS设置、 LinuxChrome 操作系统

I am trying to run a default flutter app but when I run it gives the below error:我正在尝试运行默认的flutter应用程序,但运行时会出现以下错误:

Running Gradle task 'assembleDebug'...

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 com.android.tools.build:gradle:3.5.3.
     Required by:
         project :
      > Could not resolve com.android.tools.build:gradle:3.5.3.
         > Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.5.3/gradle-3.5.3.pom'.
            > Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.5.3/gradle-3.5.3.pom'.
               > Connect to 172.30.0.15:3128 [/172.30.0.15] failed: Connection timed out: connect
      > Could not resolve com.android.tools.build:gradle:3.5.3.
         > Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.5.3/gradle-3.5.3.pom'.
            > Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.5.3/gradle-3.5.3.pom'.
               > Connect to 172.30.0.15:3128 [/172.30.0.15] failed: Connection timed out: connect
   > Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.50.
     Required by:
         project :
      > Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.50.
         > Could not get resource 'https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.3.50/kotlin-gradle-plugin-1.3.50.pom'.
            > Could not GET 'https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.3.50/kotlin-gradle-plugin-1.3.50.pom'.
               > Connect to 172.30.0.15:3128 [/172.30.0.15] failed: Connection timed out: connect
      > Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.50.
         > Could not get resource 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-gradle-plugin/1.3.50/kotlin-gradle-plugin-1.3.50.pom'.
            > Could not GET 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-gradle-plugin/1.3.50/kotlin-gradle-plugin-1.3.50.pom'.
               > Connect to 172.30.0.15:3128 [/172.30.0.15] failed: Connection timed out: connect

* 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 2m 25s
Exception: Gradle task assembleDebug failed with exit code 1

below is the build.gradle code:以下是build.gradle代码:

buildscript {
    ext.kotlin_version = '1.3.50'
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.3'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

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

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

The whole code of the app is default one, no changes have been done I have just connected an emulator and tried to run if it works and am stuuck at this assembleDebug error.该应用程序的整个代码是默认代码,没有做任何更改。我刚刚连接了一个模拟器,并尝试运行,如果它能正常工作,并且对这个组装调试错误感到厌倦。 If anyone has any idea where Im going wrong please do comment...如果有人知道我哪里出错了,请发表评论...

暂无
暂无

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

相关问题 无法解析配置 ':flutter_local_notifications:classpath' 的所有工件 - Could not resolve all artifacts for configuration ':flutter_local_notifications:classpath' Flutter:无法解析配置“:path_provider:classpath”的所有工件 - Flutter: Could not resolve all artifacts for configuration ':path_provider:classpath' Android Studio:无法解析配置“:classpath”的所有工件 - Android Studio:Could not resolve all artifacts for configuration ':classpath' Android studio 3.2.1 ArtifactResolveException:无法解析配置“:类路径”的所有工件 - Android studio 3.2.1 ArtifactResolveException: Could not resolve all artifacts for configuration ':classpath' Android Gradle 同步失败:无法解析配置“:classpath”的所有工件 - Android Gradle Sync failed: Could not resolve all artifacts for configuration ':classpath' 无法解析配置 ':qr_code_scanner:classpath' 的所有工件 - Could not resolve all artifacts for configuration ':qr_code_scanner:classpath' 无法解析配置“:classpath”的所有工件。 > 无法解析 com.android.tools.build:gradle:4.1.0 - Could not resolve all artifacts for configuration ':classpath'. > Could not resolve com.android.tools.build:gradle:4.1.0 Gradle/Flutter 中的构建错误:“无法解决配置的所有工件”? - Build error in Gradle/Flutter: 'Could not resolve all artifacts for configuration'? Flutter Image_picker 无法解析所有工件以进行配置 - Flutter Image_picker could not resolve all artifacts for configuration 错误:无法解析配置“:classpath”的所有工件。 无法解析外部依赖 X,因为没有定义存储库 - Error: Could not resolve all artifacts for configuration ':classpath'. Cannot resolve external dependency X because no repositories are defined
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM