title: Flutter/Dart error: Execution failed for task ':app:checkDebugAarMetadata'
body: <p>I recently went back to my old flutter project and updated a bunch of things because I was getting errors. Now I'm getting the error below. I have been on it for at least 3 days and have tried a bunch of different things, but I still can't seem to find the solution. Any help is much appreciated. I have also included the <code>build.gradle</code> files below:</p>
  <pre><code>FAILURE: Build failed with an exception.
  
  * What went wrong:
  Execution failed for task ':app:checkDebugAarMetadata'.
  &gt; Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
     &gt; 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 https://google.bintray.com/exoplayer/com/google/android/gms/play-services-location/maven-metadata.xml.
              &gt; Could not get resource 'https://google.bintray.com/exoplayer/com/google/android/gms/play-services-location/maven-metadata.xml'.
                 &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
  
  * 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 18s
  [!] Gradle threw an error while downloading artifacts from the network. Retrying to download...
  Exception: Gradle task assembleDebug failed with exit code 1
  </code></pre>
  <p>Below is my <code>android\build.gradle</code>:</p>
  <pre><code>buildscript {
      ext.kotlin_version = '1.4.20'
      repositories {
          google()
          //jcenter()
          mavenCentral()
          maven { url &quot;https://maven.google.com/&quot;}
      }
  
      dependencies {
          classpath 'com.google.gms:google-services:4.3.10'
          classpath 'com.android.tools.build:gradle:4.2.2'
          classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:' + String.valueOf(kotlin_version)
      }
  
  }
  
  allprojects {
      repositories {
          google()
          //jcenter()
          mavenCentral()
          maven { url &quot;https://maven.google.com/&quot;}
      }
  }
  
  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>Here's my <code>app\build.gradle</code>:</p>
  <pre><code>def localProperties = new Properties()
  def localPropertiesFile = rootProject.file('local.properties')
  if (localPropertiesFile.exists()) {
      localPropertiesFile.withReader('UTF-8') { reader -&gt;
          localProperties.load(reader)
      }
  }
  
  def flutterRoot = localProperties.getProperty('flutter.sdk')
  if (flutterRoot == null) {
      throw new FileNotFoundException(&quot;Flutter SDK not found. Define location with flutter.sdk in the local.properties file.&quot;)
  }
  
  def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
  if (flutterVersionCode == null) {
      flutterVersionCode = '1'
  }
  
  def flutterVersionName = localProperties.getProperty('flutter.versionName')
  if (flutterVersionName == null) {
      flutterVersionName = '1.0'
  }
  
  apply plugin: 'com.android.application'
  apply plugin: 'com.google.gms.google-services'
  apply plugin: 'kotlin-android'
  apply from: &quot;$flutterRoot/packages/flutter_tools/gradle/flutter.gradle&quot;
  
  android {
      compileSdkVersion 30
  
      sourceSets {
          main.java.srcDirs += 'src/main/kotlin'
      }
  
      lintOptions {
          disable 'InvalidPackage'
      }
  
      defaultConfig {
          // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
          applicationId &quot;[id here]&quot;
          minSdkVersion 21
          targetSdkVersion 30
          versionCode flutterVersionCode.toInteger()
          versionName flutterVersionName
          testInstrumentationRunner &quot;androidx.test.runner.AndroidJUnitRunner&quot;
          multiDexEnabled true
      }
  
      buildTypes {
          release {
              // TODO: Add your own signing config for the release build.
              // Signing with the debug keys for now, so `flutter run --release` works.
              signingConfig signingConfigs.debug
          }
      }
  }
  
  flutter {
      source '../..'
  }
  
  dependencies {
      implementation 'com.google.firebase:firebase-analytics:20.0.1'
      implementation &quot;org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version&quot;
      testImplementation 'junit:junit:4.12'
      androidTestImplementation 'androidx.test:runner:1.4.0'
      androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
      implementation 'com.google.android.gms:play-services-ads:20.5.0'
  
  }
  </code></pre>