如何解决无法确定任务":app:lintVitalRelease"的依赖关系[来自服务器的状态代码502:错误的网关]



嗨,我正试图构建一个flutter应用程序,但我得到了这个错误日志

FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:lintVitalRelease'.
> Could not resolve all artifacts for configuration ':app:debugRuntimeClasspath'.
> Could not resolve com.google.android.gms:play-services-location:16.+.
Required by:
project :app > project :location
> Failed to list versions for com.google.android.gms:play-services-location.
> Unable to load Maven meta-data from https://google.bintray.com/exoplayer/com/google/android/gms/play-services-location/maven-metadata.xml.
> Could not get resource 'https://google.bintray.com/exoplayer/com/google/android/gms/play-services-location/maven-metadata.xml'.
> Could not GET 'https://google.bintray.com/exoplayer/com/google/android/gms/play-services-location/maven-metadata.xml'. 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 49s

我已经尝试按照这个链接中的步骤无法获取';播放服务位置/maven元数据.xml';。从服务器接收到状态代码502:坏网关但我还是犯了错误,有办法解决这个问题吗。从昨天开始,我一直在尝试解决这个问题,但还是出现了错误。这是我的android/build.gradle

buildscript {
ext.kotlin_version = '1.3.61'
repositories {
google()
// jcenter()
mavenCentral()
}
dependencies {
// classpath 'com.android.tools.build:gradle:3.5.0'
// classpath 'com.android.tools.build:gradle:3.4.2'
classpath "com.android.tools.build:gradle:4.2.0"

classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.3'
}
}
allprojects {
repositories {
google()
// jcenter()
mavenCentral()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"

}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
//

并且我还在Gradle-wrapper.properties 中实现了distributionUrl=https://services.gradle.org/distributions/gradle-6.8-all.zip

错误日志似乎指出location插件导致了该问题。尝试更新您正在使用的插件,并运行flutter cleanflutter pub get来刷新配置的包。

最新更新