I had no issues running my project as I usually do, didn't add any dependencies but today it stopped working and throws me this error:
Launching lib\main.dart on Android SDK built for x86 in debug mode...
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':cloud_firestore:compileDebugAidl'.
> Could not resolve all task dependencies for configuration ':cloud_firestore:debugCompileClasspath'.
> Could not resolve io.grpc:grpc-core:[1.28.0].
Required by:
project :cloud_firestore > io.grpc:grpc-okhttp:1.28.0
> Failed to list versions for io.grpc:grpc-core.
> Unable to load Maven meta-data from https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml.
> Could not HEAD 'https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml'.
> org.apache.http.client.ClientProtocolException (no error message)
> Failed to list versions for io.grpc:grpc-core.
> Unable to load Maven meta-data from https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml.
> Could not HEAD 'https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml'.
> org.apache.http.client.ClientProtocolException (no error message)
> Failed to list versions for io.grpc:grpc-core.
> Unable to load Maven meta-data from https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml.
> Could not HEAD 'https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml'.
> org.apache.http.client.ClientProtocolException (no error message)
> Failed to list versions for io.grpc:grpc-core.
> Unable to load Maven meta-data from https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml.
> Could not HEAD 'https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml'.
> org.apache.http.client.ClientProtocolException (no error message)
> Failed to list versions for io.grpc:grpc-core.
> Unable to load Maven meta-data from https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml.
> Could not HEAD 'https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml'.
> org.apache.http.client.ClientProtocolException (no error message)
> Failed to list versions for io.grpc:grpc-core.
> Unable to load Maven meta-data from https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml.
> Could not HEAD 'https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml'.
> org.apache.http.client.ClientProtocolException (no error message)
> Failed to list versions for io.grpc:grpc-core.
> Unable to load Maven meta-data from https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml.
> Could not HEAD 'https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml'.
> org.apache.http.client.ClientProtocolException (no error message)
> Failed to list versions for io.grpc:grpc-core.
> Unable to load Maven meta-data from https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml.
> Could not HEAD 'https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml'.
> org.apache.http.client.ClientProtocolException (no error message)
> Failed to list versions for io.grpc:grpc-core.
> Unable to load Maven meta-data from https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml.
> Could not HEAD 'https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml'.
> org.apache.http.client.ClientProtocolException (no error message)
> Failed to list versions for io.grpc:grpc-core.
> Unable to load Maven meta-data from https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml.
> Could not HEAD 'https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml'.
> org.apache.http.client.ClientProtocolException (no error message)
> Failed to list versions for io.grpc:grpc-core.
> Unable to load Maven meta-data from https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml.
> Could not HEAD 'https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml'.
> org.apache.http.client.ClientProtocolException (no error message)
> Failed to list versions for io.grpc:grpc-core.
> Unable to load Maven meta-data from https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml.
> Could not HEAD 'https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml'.
> org.apache.http.client.ClientProtocolException (no error message)
> Failed to list versions for io.grpc:grpc-core.
> Unable to load Maven meta-data from https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml.
> Could not HEAD 'https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml'.
> org.apache.http.client.ClientProtocolException (no error message)
> Failed to list versions for io.grpc:grpc-core.
> Unable to load Maven meta-data from https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml.
> Could not HEAD 'https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml'.
> org.apache.http.client.ClientProtocolException (no error message)
> Failed to list versions for io.grpc:grpc-core.
> Unable to load Maven meta-data from https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml.
> Could not HEAD 'https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml'.
> org.apache.http.client.ClientProtocolException (no error message)
> Failed to list versions for io.grpc:grpc-core.
> Unable to load Maven meta-data from https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml.
> Could not HEAD 'https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml'.
> org.apache.http.client.ClientProtocolException (no error message)
> Failed to list versions for io.grpc:grpc-core.
> Unable to load Maven meta-data from https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml.
> Could not HEAD 'https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml'.
> org.apache.http.client.ClientProtocolException (no error message)
> Failed to list versions for io.grpc:grpc-core.
> Unable to load Maven meta-data from https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml.
> Could not HEAD 'https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml'.
> org.apache.http.client.ClientProtocolException (no error message)
> Failed to list versions for io.grpc:grpc-core.
> Unable to load Maven meta-data from https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml.
> Could not HEAD 'https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml'.
> org.apache.http.client.ClientProtocolException (no error message)
> Failed to list versions for io.grpc:grpc-core.
> Unable to load Maven meta-data from https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml.
> Could not HEAD 'https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml'.
> org.apache.http.client.ClientProtocolException (no error message)
> Failed to list versions for io.grpc:grpc-core.
> Unable to load Maven meta-data from https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml.
> Could not HEAD 'https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml'.
> org.apache.http.client.ClientProtocolException (no error message)
> Failed to list versions for io.grpc:grpc-core.
> Unable to load Maven meta-data from https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml.
> Could not HEAD 'https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml'.
> org.apache.http.client.ClientProtocolException (no error message)
> Failed to list versions for io.grpc:grpc-core.
> Unable to load Maven meta-data from https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml.
> Could not HEAD 'https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml'.
> org.apache.http.client.ClientProtocolException (no error message)
> Failed to list versions for io.grpc:grpc-core.
> Unable to load Maven meta-data from https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml.
> Could not HEAD 'https://jcenter.bintray.com/io/grpc/grpc-core/maven-metadata.xml'.
> org.apache.http.client.ClientProtocolException (no error message)
> Skipped due to earlier error
* 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 1m 4s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
My attempts to fix so far ( Flutter 1.22.6 ):
I have researched for days but so far this is the only solution I
have found https://github.com/firebase/flutterfire/issues/1615#issuecomment-564902839 which tells me to do aflutter pub cache repair
.Tried
Flutter Clean
.Deleted
pubspec.lock
Tried rebuilding
after every attempt, nothing above worked. Plucking my hairs here, help.
CodePudding user response:
Modify the build.gradle file as below
Before
repositories {
google()
jcenter()
}
After
repositories {
google()
mavenCentral()
}
Good luck.