Could not GET 'play-services-location/maven-metadata.xml'. Received status code 502 from server: Bad Gateway


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

Could not resolve all files for configuration ‘:app:debugRuntimeClasspath’.
Could not resolve
Required by:
project :app > project :location
> Failed to list versions for
> Unable to load Maven meta-data from
> Could not get resource ‘’.
> Could not GET ‘’. Received status code 502 from server: Bad Gateway

acutely I’m using classpath ''with distributionUrl=
I have followed this question
and I upgraded '' to classpath '' then I changed distributionUrl= to distributionUrl=https\:// but I still got the error.

my android/build.gradle:

buildscript {
    repositories {

    dependencies {
        classpath ''

allprojects {
    repositories {

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${}"
subprojects {

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



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


The problem is that a plugin (location in this case) didn’t specify a fixed version of an Android library. So in order to find which versions are available, Gradle must go to the repository to check. In this case, that repository is Bintray, which has been down for days and returning HTTP 502 Bad Request.

The steps below provide a quick and dirty workaround so you can build the app while Bintray is down. A more proper solution would be to fork the plugin and make changes to your fork as suggested by Eldar Miensutov, but it might be a bit overkill for a temporary server error.

  1. In the Project tool window (where your files are listed), scroll all the way down until you find Flutter Plugins. If you don’t see it, make sure that Project is selected in the dropdown at the top of the Project tool window.
  2. Open Flutter plugins, find location-4.0.0 and open it (you might have a different version number after location-, that’s fine).
  3. Open the file location-4.0.0/android/build.gradle
  4. Find the line api ''
  5. Change it to api ''. If your editor says that the file does not belong to your project, select "I want to edit this file anyway".

You should now be able to build the app.

This change is of course a temporary solution, and if you update the location plugin your changes will be overwritten. But at least you’ll be able to build until Bintray comes online again (or until you had time to migrate to another more recently updated plugin).


In case the problem is caused by the location plugin and you are able to update to the latest version of it (4.3.0 at the moment), that also seems to resolve the problem. In my case, I was stuck on an old version of Flutter and location because of some other packages that weren’t compatible with Flutter 2.

Answered By – Magnus

Answer Checked By – Clifford M. (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *