3

When I launched my app, I got this error message. I did not make any changes since last run, when everything was fine. Does anybody know how to solve this? Thank you.

FAILURE: Build failed with an exception.
  • What went wrong: Could not determine the dependencies of task ':app:processDebugResources'.

Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'. Could not resolve io.grpc:grpc-core:[1.28.0]. Required by: project :app > project :cloud_firestore > com.google.firebase:firebase-firestore:22.1.2 > io.grpc:grpc-android:1.28.0 project :app > project :cloud_firestore > com.google.firebase:firebase-firestore:22.1.2 > io.grpc:grpc-okhttp:1.28.0 > Failed to list versions for io.grpc:grpc-core. > Unable to load Maven meta-data from https://google.bintray.com/exoplayer/io/grpc/grpc-core/maven-metadata.xml. > Could not get resource 'https://google.bintray.com/exoplayer/io/grpc/grpc-core/maven-metadata.xml'. > Could not GET 'https://google.bintray.com/exoplayer/io/grpc/grpc-core/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 6s Exception: Gradle task assembleDebug failed with exit code 1

3
  • I've got same error =( Yesterday build was ok Commented Nov 30, 2021 at 8:40
  • Same issue here too. Build was working fine in the morning, but a few hours later I get this "502 Bad Gateway" error. Did you solve it? Commented Nov 30, 2021 at 16:09
  • You can adopt this answer stackoverflow.com/a/70360614/12052309 You have to strictly set version for io.grpc:grpc-core Commented Dec 15, 2021 at 8:53

3 Answers 3

4

The solution I founded was upgrade all my packages.

flutter pub upgrade --major-versions

After treat all the issues and problems.

Upgrade the kotlin version too.

from ext.kotlin_version = '1.3.50' to ext.kotlin_version = '1.4.32'

Or the latest Kotlin version.

Try to run your project again.

Sign up to request clarification or add additional context in comments.

2 Comments

The solution above worked for me. My error follows Could not resolve org.jetbrains.kotlin:kotlin-stdlib-jdk7:+ and ends with the same "exoplayer" error. There are at least 2 other dupes. I ran flutter clean then flutter pub upgrade --major-versions, and had to fix other broken deps afterwards, but I'm out of this quagmire. THANK YOU
Thanks Leonardo. Your answer helped a lot. I had to also upgrade gradle according to this advice github.com/ivpusic/react-native-image-crop-picker/issues/1406
1

Basic problem that version of io.grpc:grpc-core:[1.28.0] is not specified strictly and gradle have to find possible versions but google.bintray.com is down - no version listing available

  1. Find what version is - this [1.28.0] mean it has versions range Gradle Declaring Versions and Ranges

  2. The [ and ] symbols indicate an inclusive bound with only one version - so consider take exactly 1.28.0

  3. Constrain your transitive dependency with maximum possible version 1.28.0

Edit your project app/build.gradle:

dependencies {
  ...
  constraints {
    implementation('io.grpc:grpc-core') {
        version {
            strictly '1.28.0'
        }
    }
  }
}

Comments

1

Follow these three steps

1. flutter pub cache repair.

2. flutter Clean.

Finally and the most important

3. Modify the build.gradle file as below change jcenter() to mavenCentral() everywhare

Before

 repositories {
        google()
        jcenter()
 }

After

 repositories {
        google()
        mavenCentral()
 }

Good luck.

Comments

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.