'How to solve Could not determine the dependencies of task ':app:lintVitalRelease' [status code 502 from server: Bad Gateway]

Hi I am trying to build an app of flutter, but I get this error log

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

I have tried to follow the step in this link Could not GET 'play-services-location/maven-metadata.xml'. Received status code 502 from server: Bad Gateway but I still get the error, is there a way to sole this case. I have been trying to solve this since yesterday, but still get the error. And here is my 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
}

//

and also I implement distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-all.zip inside Gradle-wrapper.properties



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source