title: flutter android - Failed to list versions for com.google.android.gms:play-services-location
body: <p>Got this err when compiling android, the used to be compiling ok but I have no idea what went wrong.</p>
  
  <p>Ios compiles and works fine tho. I tried a few things including check gradle file has google() and the correct version etc but nothing helps. 
                   *********************************************************
      FAILURE: Build failed with an exception.</p>
  
  <pre><code>WARNING: This version of cloud_firestore will break your Android build if it or its dependencies aren't compatible with AndroidX.
  * What went wrong:
  Could not determine the dependencies of task ':app:preDebugBuild'.
           See goo.gl/CP92wY for more information on the problem and how to fix it.
  &gt; Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
           This warning prints for all Android build failures. The real root cause of the error may be unrelated.
     &gt; Could not resolve com.google.android.gms:play-services-location:15.+.
           *********************************************************
       Required by:
           project :app &gt; project :location
        &gt; Failed to list versions for com.google.android.gms:play-services-location.
           &gt; Could not list versions using M2 pattern 'https://raw.github.com/g123k/ShortcutBadger/master/[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier])(.[ext])'.
              &gt; Could not get resource 'https://raw.github.com/g123k/ShortcutBadger/master/com/google/android/gms/play-services-location/'.
                 &gt; Could not GET 'https://raw.github.com/g123k/ShortcutBadger/master/com/google/android/gms/play-services-location/'. Received status code 400 from server: Bad Request
  
  * 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 23s
  Finished with error: Gradle task assembleDebug failed with exit code 1
  </code></pre>
  
  <p>root build.gradle</p>
  
  <pre><code>buildscript {
      repositories {
          google()
          jcenter()
          mavenLocal()
      }
  
      dependencies {
          classpath 'com.android.tools.build:gradle:3.3.1'  // it was 3.3.1 before but didnt compile, 3.2.1 compiles but with firebase errors
          classpath 'com.google.gms:google-services:4.2.0'
      }
  }
  
  allprojects {
      repositories {
          google()
          jcenter()
          mavenLocal()
      }
  }
  
  rootProject.buildDir = '../build'
  subprojects {
      project.buildDir = "${rootProject.buildDir}/${project.name}"
  }
  subprojects {
      project.evaluationDependsOn(':app')
  }
  
  task clean(type: Delete) {
      delete rootProject.buildDir
  }
  </code></pre>
  
  <p>app build.gradle</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><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 GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
  }
  
  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 from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
  
  def keystoreProperties = new Properties()
  def keystorePropertiesFile = rootProject.file('key.properties')
  if (keystorePropertiesFile.exists()) {
      keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
  }
  
  android {
      compileSdkVersion 28
  
      lintOptions {
          disable 'InvalidPackage'
      }
  
      defaultConfig {
          // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
          applicationId "com.berkey.berkey"
          minSdkVersion 21
          targetSdkVersion 28
          versionCode flutterVersionCode.toInteger()
          versionName flutterVersionName
          testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
          multiDexEnabled true
      }
  
  //    implementation 'androidx.appcompat:appcompat:1.1.0-alpha01'
  //    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
  //
  //    android.useAndroidX=true
  //    android.enableJetifier=true
  
      signingConfigs {
          release {
              keyAlias keystoreProperties['keyAlias']
              keyPassword keystoreProperties['keyPassword']
              storeFile file(keystoreProperties['storeFile'])
              storePassword keystoreProperties['storePassword']
          }
      }
  
      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.release
  
          }
      }
  }
  
  flutter {
      source '../..'
  }
  
  dependencies {
  //    testImplementation 'junit:junit:4.12'
  //    androidTestImplementation 'com.android.support.test:runner:1.0.2'
  //    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
      testImplementation 'junit:junit:4.12'
      androidTestImplementation 'androidx.test:runner:1.1.1'
      androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
  }
  
  apply plugin: 'com.google.gms.google-services'</code></pre>
  </div>
  </div>
  </p>
  
  <p>Pubspec.yaml</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>description: A new Flutter project.
  version: 1.2.0+3
  
  environment:
    sdk: "&gt;=2.0.0-dev.68.0 &lt;3.0.0"
  
  dependencies:
    flutter:
      sdk: flutter
    algolia: ^0.1.3+2
    firebase_auth: ^0.8.0+3
    cupertino_icons: ^0.1.2
    google_sign_in: ^4.0.1
    cloud_firestore: ^0.9.0+1
    firebase_storage: ^2.0.1
    image_picker: ^0.5.0+3
    location: ^2.0.0
    firebase_messaging: ^3.0.1
    geolocator: ^3.0.0
    firebase_core: ^0.3.0+1
    flutter_launcher_icons: "^0.7.0"
    flutter_linkify: 1.0.3
    url_launcher: ^5.0.1
    permission_handler: '^2.2.0'
    flutter_app_badger: ^1.0.2</code></pre>
  </div>
  </div>
  </p>
  
  <p>flutter doctor</p>
  
  <p><code>[✓] Flutter (Channel stable, v1.0.0, on Mac OS X 10.14.2 18C54, locale en-AU)
  [✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
  [!] iOS toolchain - develop for iOS devices (Xcode 10.1)
      ✗ Verify that all connected devices have been paired with this computer in Xcode.
        If all devices have been paired, libimobiledevice and ideviceinstaller may require updating.
        To update with Brew, run:
          brew update
          brew uninstall --ignore-dependencies libimobiledevice
          brew uninstall --ignore-dependencies usbmuxd
          brew install --HEAD usbmuxd
          brew unlink usbmuxd
          brew link usbmuxd
          brew install --HEAD libimobiledevice
          brew install ideviceinstaller
  [✓] Android Studio (version 3.3)
  [✓] Connected device (1 available)</code></p>