朋友们,我在建设项目的时候遇到了这个问题,是什么问题呢?我的网络没有问题,以前很好用,现在就这样了
FAILURE: Build failed with an exception.
- 出了什么问题:配置根项目"android"时出现问题。
Could not resolve all files for configuration ':classpath'. Could not download gradle-7.1.2.jar (com.android.tools.build:gradle:7.1.2) > Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/7.1.2/gradle-7.1.2.jar'. > Read timed out Could not download builder-7.1.2.jar (com.android.tools.build:builder:7.1.2) > Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/builder/7.1.2/builder-7.1.2.jar'. > Read timed out Could not download sdk-common-30.1.2.jar (com.android.tools:sdk-common:30.1.2) > Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/sdk-common/30.1.2/sdk-common-30.1.2.jar'. > Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/sdk-common/30.1.2/sdk-common-30.1.2.jar'. > Read timed out Could not download repository-30.1.2.jar (com.android.tools:repository:30.1.2) > Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/repository/30.1.2/repository-30.1.2.jar'. > Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/repository/30.1.2/repository-30.1.2.jar'. > Read timed out Could not download databinding-common-7.1.2.jar (androidx.databinding:databinding-common:7.1.2) > Could not get resource 'https://dl.google.com/dl/android/maven2/androidx/databinding/databinding-common/7.1.2/databinding-common-7.1.2.jar'. > Could not GET 'https://dl.google.com/dl/android/maven2/androidx/databinding/databinding-common/7.1.2/databinding-common-7.1.2.jar'. > Read timed out Could not download baseLibrary-7.1.2.jar (com.android.databinding:baseLibrary:7.1.2) > Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/databinding/baseLibrary/7.1.2/baseLibrary-7.1.2.jar'. > Could not GET 'https://dl.google.com/dl/android/maven2/com/android/databinding/baseLibrary/7.1.2/baseLibrary-7.1.2.jar'. > Read timed out Could not download kotlin-compiler-embeddable-1.6.10.jar (org.jetbrains.kotlin:kotlin-compiler-embeddable:1.6.10) > Could not get resource 'https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-compiler-embeddable/1.6.10/kotlin-compiler-embeddable-1.6.10.jar'. > Could not GET 'https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-compiler-embeddable/1.6.10/kotlin-compiler-embeddable-1.6.10.jar'. Received status code 502 from server: Bad Gateway Could not download dagger-2.28.3.jar (com.google.dagger:dagger:2.28.3) > Could not get resource 'https://repo.maven.apache.org/maven2/com/google/dagger/dagger/2.28.3/dagger-2.28.3.jar'. > Could not HEAD 'https://repo.maven.apache.org/maven2/com/google/dagger/dagger/2.28.3/dagger-2.28.3.jar'. > The server may not support the client's requested TLS protocol versions: (TLSv1.2, TLSv1.3). You may need to configure the client to allow other protocols to be used. See: https://docs.gradle.org/7.4/userguide/build_environment.html#gradle_system_properties > Remote host terminated the handshake Could not download kxml2-2.3.0.jar (net.sf.kxml:kxml2:2.3.0) > Could not get resource 'https://repo.maven.apache.org/maven2/net/sf/kxml/kxml2/2.3.0/kxml2-2.3.0.jar'. > Could not HEAD 'https://repo.maven.apache.org/maven2/net/sf/kxml/kxml2/2.3.0/kxml2-2.3.0.jar'. > Read timed out Could not download trove4j-1.0.20181211.jar (org.jetbrains.intellij.deps:trove4j:1.0.20181211) > Could not get resource 'https://repo.maven.apache.org/maven2/org/jetbrains/intellij/deps/trove4j/1.0.20181211/trove4j-1.0.20181211.jar'. > Could not GET 'https://repo.maven.apache.org/maven2/org/jetbrains/intellij/deps/trove4j/1.0.20181211/trove4j-1.0.20181211.jar'. > Read timed out Could not download xercesImpl-2.12.0.jar (xerces:xercesImpl:2.12.0) > Could not get resource 'https://repo.maven.apache.org/maven2/xerces/xercesImpl/2.12.0/xercesImpl-2.12.0.jar'. > Could not HEAD 'https://repo.maven.apache.org/maven2/xerces/xercesImpl/2.12.0/xercesImpl-2.12.0.jar'. > Read timed out Could not download commons-compress-1.20.jar (org.apache.commons:commons-compress:1.20) > Could not get resource 'https://repo.maven.apache.org/maven2/org/apache/commons/commons-compress/1.20/commons-compress-1.20.jar'. > Could not HEAD 'https://repo.maven.apache.org/maven2/org/apache/commons/commons-compress/1.20/commons-compress-1.20.jar'. > The server may not support the client's requested TLS protocol versions: (TLSv1.2, TLSv1.3). You may need to configure the client to allow other protocols to be used. See: https://docs.gradle.org/7.4/userguide/build_environment.html#gradle_system_properties > Remote host terminated the handshake Could not download httpclient-4.5.6.jar (org.apache.httpcomponents:httpclient:4.5.6) > Could not get resource 'https://repo.maven.apache.org/maven2/org/apache/httpcomponents/httpclient/4.5.6/httpclient-4.5.6.jar'. > Could not GET 'https://repo.maven.apache.org/maven2/org/apache/httpcomponents/httpclient/4.5.6/httpclient-4.5.6.jar'. > Read timed out Could not download httpcore-4.4.10.jar (org.apache.httpcomponents:httpcore:4.4.10) > Could not get resource 'https://repo.maven.apache.org/maven2/org/apache/httpcomponents/httpcore/4.4.10/httpcore-4.4.10.jar'. > Could not GET 'https://repo.maven.apache.org/maven2/org/apache/httpcomponents/httpcore/4.4.10/httpcore-4.4.10.jar'. Received status code 502 from server: Bad Gateway Could not download javax.activation-1.2.0.jar (com.sun.activation:javax.activation:1.2.0) > Could not get resource 'https://repo.maven.apache.org/maven2/com/sun/activation/javax.activation/1.2.0/javax.activation-1.2.0.jar'. > Could not HEAD 'https://repo.maven.apache.org/maven2/com/sun/activation/javax.activation/1.2.0/javax.activation-1.2.0.jar'. Received status code 502 from server: Bad Gateway
- 试试看:
使用--stacktrace选项运行以获得堆栈跟踪。使用--info或--debug选项运行以获得更多日志输出。使用--scan运行以获得完整的见解。
- 从https://help.gradle.org获取更多帮助
构建在15分钟49秒内失败,正在重试Gradle构建:#1,等待时间:100ms [!] Gradle在从网络下载工件时引发错误。
1条答案
按热度按时间c86crjj01#
请尝试以下步骤:
flutter clean
flutter upgrade
Android Studio 内部:
invalidate cache
repair ide
restart ide
如果您能分享您的build.gradle文件,我们将不胜感激。您也可以尝试进入
sdk manager
查看是否有任何软件包需要更新或重新下载。