0

enter image description hereFAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:checkDebugAarMetadata'.

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

2 Answers 2

3

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'
    }
  }
}
Sign up to request clarification or add additional context in comments.

Comments

0

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

2 Comments

Thank you for responding. Actually, I'm working with Flutter so I don't have any idea about Android. Can you tell me in which file I need to fix it?
@GulAhmed How shall I know? The above is an error message, without the code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.