无法 GET 'play-services-location/maven-metadata.xml'.从服务器收到状态代码 502:Bad Gateway [英] Could not GET 'play-services-location/maven-metadata.xml'. Received status code 502 from server: Bad Gateway

查看:221
本文介绍了无法 GET 'play-services-location/maven-metadata.xml'.从服务器收到状态代码 502:Bad Gateway的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个昨天运行良好的项目,但今天我发现了这个问题:

I have a project which was running well yesterday, but today I find this problem:

无法解析配置:app:debugRuntimeClasspath"的所有文件.无法解析 com.google.android.gms:play-services-location:16.+.要求:项目:应用程序>项目:位置>无法列出 com.google.android.gms:play-services-location 的版本.>无法从 https://google.bintray.com/exoplayer/com/google/android/gms/play-services-location/maven-metadata.xml.>无法获取资源https://google.bintray.com/exoplayer/com/google/android/gms/play-services-location/maven-metadata.xml".>无法获取https://google.bintray.com/exoplayer/com/google/android/gms/play-services-location/maven-metadata.xml".从服务器收到状态代码 502:Bad Gateway

Could not resolve all files 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

我正在使用 classpath 'com.android.tools.build:gradle:4.1.0'distributionUrl=https://services.gradle.org/distributions/gradle-6.5-bin.zip我关注了这个问题然后我将 'com.android.tools.build:gradle:4.1.0' 升级到 classpath 'com.android.tools.build:gradle:4.2.0' 然后我将 distributionUrl=https://services.gradle.org/distributions/gradle-6.5-bin.zip 更改为 distributionUrl=https://services.gradle.org/distributions/gradle-6.7.1-all.zip 但我仍然遇到错误.

acutely I'm using classpath 'com.android.tools.build:gradle:4.1.0'with distributionUrl=https://services.gradle.org/distributions/gradle-6.5-bin.zip I have followed this question and I upgraded 'com.android.tools.build:gradle:4.1.0' to classpath 'com.android.tools.build:gradle:4.2.0' then I changed distributionUrl=https://services.gradle.org/distributions/gradle-6.5-bin.zip to distributionUrl=https://services.gradle.org/distributions/gradle-6.7.1-all.zip but I still got the error.

我的 android/build.gradle:

my android/build.gradle:

buildscript {
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:4.2.0'
    }
}

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
}

和 gradle-wrapper.properties:

and gradle-wrapper.properties:

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https://services.gradle.org/distributions/gradle-6.7.1-all.zip

此外,我已将 compileSdkVersionminSdkVersiontargetSdkVersion 更改为 30,但什么也没发生.

Also I have changed the compileSdkVersion , minSdkVersion and targetSdkVersion to be 30 but nothing happened.

推荐答案

这看起来像是一个临时问题,带有这些库的服务器已关闭.我现在在 Room 也有同样的问题:

It looks like a temporary issue, the server with these libraries is down. I have the same problem now with Room:

Could not GET 'https://google.bintray.com/exoplayer/androidx/room/room-common/maven-metadata.xml'. Received status code 502 from server: Bad Gateway

如果您使用的是 Android Studio,您可以尝试使用离线模式,如果您拥有该库的缓存版本,它将使用该库的缓存版本,直到它被修复.

You can try using offline mode if you're using Android Studio, then it will use the cached version of this library if you have it until it is fixed.

UPD. 我切换到了 flutter lib 的 alpha 版本,这导致了这个问题(workmanager),现在运行良好.据我了解,这取决于旧版本的 Android Room 库,由于 Bintray 不可用,该库不再可用.可以通过另一个链接下载新版本的 Room.因此,对于您来说,解决方案可能是更新到较新版本的 Flutter 位置包或对其进行分叉并将 play-services-location 的版本更改为最新版本.

UPD. I switched to an alpha version of a flutter lib which caused this (workmanager) and it works well now. As far as I understand it was depending on an old version of Android Room library which is not available anymore since Bintray is not available. The new version of Room is available as it's being downloaded thorough another link. So for you the solution could be updating to a newer version of Flutter location package or forking it and changing the version of play-services-location to the most recent one.

这篇关于无法 GET 'play-services-location/maven-metadata.xml'.从服务器收到状态代码 502:Bad Gateway的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆