6

Hi I am trying to build my flutter app (debug/release). Every thing were fine till yesterday but Today since morning If I build my app (debug/release) I am facing below exception

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:processDevDebugResources'.
> Could not resolve all task dependencies for configuration ':app:devDebugRuntimeClasspath'.
   > 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

These are my Flutter and Dart Versions:

  • Flutter 2.5.3
  • Dart 2.14.4

Location Plugin :

location: ^4.3.0

Distribution URL in gradle.properties:

distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip

Project Level Gradle:

buildscript {
    ext.kotlin_version = '1.4.21'
    repositories {
        google()
        mavenCentral()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:4.0.1'
        classpath 'com.google.gms:google-services:4.3.4'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.4.1'

    }
}

allprojects {
    repositories {
        google()
        mavenCentral()
        jcenter()
    }
}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
Sanjay Kumar
  • 1,135
  • 14
  • 27
  • 1
    Looks like [`https://google.bintray.com/`](https://google.bintray.com/) is down. Maybe try again later. – Stefan Galler Nov 30 '21 at 10:50
  • After running ./gradlew build --stacktrace received this : Caused by: org.gradle.internal.resolve.ModuleVersionResolveException: Could not resolve com.google.android.gms:play-services-location:16.+. Required by: project :app > project :location – Sanjay Kumar Nov 30 '21 at 10:57
  • I believe I have the same issue, in a personal Flutter project. I am not familiar with gradle / kotlin and the project was building yesterday, but not today, failing with this similar error `[ ] > Could not resolve org.jetbrains.kotlin:kotlin-stdlib-jdk7:+. [ ] Required by: [ ] project :app [ ] > Failed to list versions for org.jetbrains.kotlin:kotlin-stdlib-jdk7.`. These lines precede the exoroject error like OP. My project does not declare exoproject so this is utterly confusing. – directed laugh Nov 30 '21 at 16:20
  • 1
    google.bintray.com is 502-ing as of this comment. I found several other discussions from different sites without a permanent resolution, as it seems like bintray is shutting down, so should be considered deprecated. I hope a gradler can comment on how to switch out bintray resolvers with (presumably) google, assuming that's possible. And if you do, please assume your audience doesn't know where/what all the gradle special files are. – directed laugh Nov 30 '21 at 16:24
  • [dupe 1, play services](https://stackoverflow.com/questions/70166663/could-not-get-play-services-location-maven-metadata-xml-received-status-code), [dupe 2, firestore](https://stackoverflow.com/questions/70166263/flutter-build-failed-with-an-exception); Dupe 2 contains a working solution for me. – directed laugh Nov 30 '21 at 16:47
  • Update my question, try this [my question ](https://stackoverflow.com/questions/70309075/problems-in-android-repository-flutter-tensorflow-lite-by-bintray-502?noredirect=1#comment124315942_70309075) – Nautilus Dec 14 '21 at 20:37

1 Answers1

4

Thanks for response on my Question. After spending long time I found the solution.

I followed some steps below :

Update gradle.properties file as:

distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip

Update dependency in project level build.gradle file as:

classpath 'com.android.tools.build:gradle:4.0.1'

Clean and get pug:

flutter clean
flutter pub get

Now build your project. It worked successfully.

I guess my issue was related to distributionUrl

Sanjay Kumar
  • 1,135
  • 14
  • 27