繁体   English   中英

Gradle 从网络下载工件时抛出错误。 正在重试下载... 在 android 工作室

[英]Gradle threw an error while downloading artifacts from the network. Retrying to download... in android studio

当我尝试构建 android 应用程序时,我收到此错误:

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:processTESTDebugResources'.
> Could not resolve all task dependencies for configuration ':app:TESTDebugRuntimeClasspath'.
   > Could not resolve io.flutter:arm64_v8a_debug:1.0.0-40a99c595137e4b2f5b2efa8ff343ea23c1e16b8.
     Required by:
         project :app
      > Could not resolve io.flutter:arm64_v8a_debug:1.0.0-40a99c595137e4b2f5b2efa8ff343ea23c1e16b8.
         > Could not get resource 'https://google.bintray.com/exoplayer/io/flutter/arm64_v8a_debug/1.0.0-40a99c595137e4b2f5b2efa8ff343ea23c1e16b8/arm64_v8a_debug-1.0.0-40a99c595137e4b2f5b2efa8ff343ea23c1e16b8.pom'.
            > Could not GET 'https://google.bintray.com/exoplayer/io/flutter/arm64_v8a_debug/1.0.0-40a99c595137e4b2f5b2efa8ff343ea23c1e16b8/arm64_v8a_debug-1.0.0-40a99c595137e4b2f5b2efa8ff343ea23c1e16b8.pom'. Received status code 502 from server: Bad Gateway
   > Could not resolve io.flutter:x86_debug:1.0.0-40a99c595137e4b2f5b2efa8ff343ea23c1e16b8.
     Required by:
         project :app
      > Could not resolve io.flutter:x86_debug:1.0.0-40a99c595137e4b2f5b2efa8ff343ea23c1e16b8.
         > Could not get resource 'https://google.bintray.com/exoplayer/io/flutter/x86_debug/1.0.0-40a99c595137e4b2f5b2efa8ff343ea23c1e16b8/x86_debug-1.0.0-40a99c595137e4b2f5b2efa8ff343ea23c1e16b8.pom'.
            > Could not GET 'https://google.bintray.com/exoplayer/io/flutter/x86_debug/1.0.0-40a99c595137e4b2f5b2efa8ff343ea23c1e16b8/x86_debug-1.0.0-40a99c595137e4b2f5b2efa8ff343ea23c1e16b8.pom'. Received status code 502 from server: Bad Gateway
   > Could not resolve io.flutter:x86_64_debug:1.0.0-40a99c595137e4b2f5b2efa8ff343ea23c1e16b8.
     Required by:
         project :app
      > Could not resolve io.flutter:x86_64_debug:1.0.0-40a99c595137e4b2f5b2efa8ff343ea23c1e16b8.
         > Could not get resource 'https://google.bintray.com/exoplayer/io/flutter/x86_64_debug/1.0.0-40a99c595137e4b2f5b2efa8ff343ea23c1e16b8/x86_64_debug-1.0.0-40a99c595137e4b2f5b2efa8ff343ea23c1e16b8.pom'.
            > Could not GET 'https://google.bintray.com/exoplayer/io/flutter/x86_64_debug/1.0.0-40a99c595137e4b2f5b2efa8ff343ea23c1e16b8/x86_64_debug-1.0.0-40a99c595137e4b2f5b2efa8ff343ea23c1e16b8.pom'. Received status code 502 from server: Bad Gateway

* 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 7m 30s
[!] Gradle threw an error while downloading artifacts from the network. Retrying to download...

我正在使用 Mac OS、flutter 和 android 工作室。 我可以构建 iOS 应用程序而不会出现任何此类错误。我该如何解决这个问题?

这个我试过

Go to flutter_app => android => gradle => wrapper directory
Delete gradle-wrapper.jar file
Open and edit gradle-wrapper.properties file
Change distributionUrl=https://services.gradle.org/distributions/gradle-x.x.x-all.zip to gradle-7.2-all.zip or latest
On terminal use flutter run command

但我仍然得到同样的错误。

这是我的 android/build.gradle 文件: 在此处输入图像描述

正如堆栈跟踪中所说,尝试从 url https://google.bintray.com/下载依赖项,但得到502 http error 如果您在浏览器上测试此链接,您也会收到此错误。 请参阅此链接,这可能是存储库中的临时错误。

您还可以将 build.gradle 中的repository关闭中的所有jcenter() build.gradlemavenCentral() 同步 Gradle 并重新构建。

暂无
暂无

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM