Reputation: 13
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
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 21s
Upvotes: 0
Views: 3250
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
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