title: Flutter error : Could not resolve com.google.android.gms:play-services-location:16.+, Status code 502
body: <p>Looks like Bintray library is down and I am not able to build my app. I tried a lot of solutions but none them worked.
  A similar github issue is there which is already closed without any proper help.
  Github link: <a href="https://github.com/flutter/flutter/issues/94400" rel="nofollow noreferrer">https://github.com/flutter/flutter/issues/94400</a></p>
  <p><strong>This is the error I am getting :</strong></p>
  <p>Launching lib\main.dart on sdk gphone x86 arm in debug mode...
  Running Gradle task 'assembleDebug'...</p>
  <p>FAILURE: Build failed with an exception.</p>
  <ul>
  <li>What went wrong:
  Execution failed for task ':app:checkDebugAarMetadata'.</li>
  </ul>
  <blockquote>
  <p>Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
  Could not resolve com.google.android.gms:play-services-location:16.+.
  Required by:
  project :app &gt; project :location
  &gt; Failed to list versions for com.google.android.gms:play-services-location.
  &gt; Unable to load Maven meta-data from <a href="https://google.bintray.com/exoplayer/com/google/android/gms/play-services-location/maven-metadata.xml" rel="nofollow noreferrer">https://google.bintray.com/exoplayer/com/google/android/gms/play-services-location/maven-metadata.xml</a>.
  &gt; 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</p>
  </blockquote>
  <ul>
  <li>Try:</li>
  </ul>
  <blockquote>
  <p>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.</p>
  </blockquote>
  <ul>
  <li>Get more help at <a href="https://help.gradle.org" rel="nofollow noreferrer">https://help.gradle.org</a></li>
  </ul>
  <p>BUILD FAILED in 10s
  Exception: Gradle task assembleDebug failed with exit code 1</p>
  <p><strong>android\build.gradle</strong></p>
  <pre><code>buildscript {
      repositories {
          google()
          mavenCentral()
          maven {
              url 'https://dl.google.com/dl/android/maven2'
          }
  //        jcenter()
      }
  
      dependencies {
          classpath 'com.android.tools.build:gradle:4.2.0'
          classpath 'com.google.gms:google-services:4.3.10'
      }
  }
  
  allprojects {
      repositories {
          google()
          mavenCentral()
          maven {
              url 'https://dl.google.com/dl/android/maven2'
          }
  //        jcenter()
      }
  }
  
  rootProject.buildDir = '../build'
  subprojects {
      project.buildDir = &quot;${rootProject.buildDir}/${project.name}&quot;
  }
  subprojects {
      project.evaluationDependsOn(':app')
  }
  
  task clean(type: Delete) {
      delete rootProject.buildDir
  }
  </code></pre>
  <p><strong>gradle-wrapper.properties</strong></p>
  <pre><code>distributionBase=GRADLE_USER_HOME
  distributionPath=wrapper/dists
  distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.1-bin.zip
  zipStoreBase=GRADLE_USER_HOME
  zipStorePath=wrapper/dists
  </code></pre>
  <p>** flutter doctor -v **</p>
  <p>[√] Flutter (Channel stable, 2.2.3, on Microsoft Windows [Version 10.0.19044.1348], locale en-US)
  • Flutter version 2.2.3 at C:\Users\PC\Documents\src\flutter
  • Framework revision f4abaa0735 (5 months ago), 2021-07-01 12:46:11 -0700
  • Engine revision 241c87ad80
  • Dart version 2.13.4</p>
  <p>[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
  • Android SDK at C:\Users\PC\AppData\Local\Android\sdk
  • Platform android-31, build-tools 30.0.3
  • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
  • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6842174)
  • All Android licenses accepted.</p>
  <p>[√] Chrome - develop for the web
  • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe</p>
  <p>[√] Android Studio
  • Android Studio at C:\Program Files\Android\Android Studio
  • Flutter plugin can be installed from:
  <a href="https://plugins.jetbrains.com/plugin/9212-flutter" rel="nofollow noreferrer">https://plugins.jetbrains.com/plugin/9212-flutter</a>
  • Dart plugin can be installed from:
  <a href="https://plugins.jetbrains.com/plugin/6351-dart" rel="nofollow noreferrer">https://plugins.jetbrains.com/plugin/6351-dart</a>
  • android-studio-dir = C:\Program Files\Android\Android Studio
  • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6842174)</p>
  <p>[√] VS Code (version 1.62.3)
  • VS Code at C:\Users\PC\AppData\Local\Programs\Microsoft VS Code
  • Flutter extension version 3.25.0</p>
  <p>[√] Connected device (3 available)
  • sdk gphone x86 arm (mobile) • emulator-5554 • android-x86    • Android 11 (API 30) (emulator)
  • Chrome (web)                • chrome        • web-javascript • Google Chrome 96.0.4664.93
  • Edge (web)                  • edge          • web-javascript • Microsoft Edge 96.0.1054.43</p>
  <p>• No issues found!</p>