Gul Ahmed
Gul Ahmed

Reputation: 13

Execution failed for task ':app:checkDebugAarMetadata'. Could not resolve com.google.android.gms:play-services-location:16.+

enter image description hereFAILURE: Build failed with an exception.

Could not resolve all files 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

BUILD FAILED in 21s

Upvotes: 0

Views: 3250

Answers (2)

Sergey Salnikov
Sergey Salnikov

Reputation: 1791

Main problem that location:3.2.4 has no strict Android dependency version play-services-location:16.+ and Gradle can't list version because google.bintray.com is down

Straight way to workaround this problem is to add Gradle Constraints on transitive dependency and specify concrete version

You have to edit your project file app/build.gradle

dependencies {
...
  constraints {
    implementation('com.google.android.gms:play-services-location') {
        version {
            strictly "16.0.0"
        }
        because 'location: 3.2.4 does not specify version & google.bintray.com answers 502 Bad Gateway'
    }
  }
}

Upvotes: 3

Martin Zeitler
Martin Zeitler

Reputation: 76809

The repository URL is wrong; you might have to add google():

https://maven.google.com/web/index.html?q=loca#com.google.android.gms:play-services-location:19.0.0

Upvotes: 0

Related Questions