Reputation: 148
Getting this error when I run flutter both on emulator or physical device in my fedora linux. I have tried different Maven Central Repository maven { url "https://jcenter.bintray.com" } but no luck. Launching lib/main.dart on SM G970U in debug mode... Running Gradle task 'assembleDebug'...
FAILURE: Build failed with an exception.
Could not resolve all files for configuration ':classpath'. Could not download httpmime-4.5.6.jar (org.apache.httpcomponents:httpmime:4.5.6) > Could not get resource 'https://repo.maven.apache.org/maven2/org/apache/httpcomponents/httpmime/4.5.6/httpmime-4.5.6.jar'. > Could not HEAD 'https://repo.maven.apache.org/maven2/org/apache/httpcomponents/httpmime/4.5.6/httpmime-4.5.6.jar'. > repo.maven.apache.org Could not download commons-io-2.4.jar (commons-io:commons-io:2.4) > Could not get resource 'https://repo.maven.apache.org/maven2/commons-io/commons-io/2.4/commons-io-2.4.jar'. > Could not HEAD 'https://repo.maven.apache.org/maven2/commons-io/commons-io/2.4/commons-io-2.4.jar'. > repo.maven.apache.org Could not download asm-commons-9.1.jar (org.ow2.asm:asm-commons:9.1) > Could not get resource 'https://repo.maven.apache.org/maven2/org/ow2/asm/asm-commons/9.1/asm-commons-9.1.jar'. > Could not HEAD 'https://repo.maven.apache.org/maven2/org/ow2/asm/asm-commons/9.1/asm-commons-9.1.jar'. > repo.maven.apache.org Could not download asm-util-9.1.jar (org.ow2.asm:asm-util:9.1) > Could not get resource 'https://repo.maven.apache.org/maven2/org/ow2/asm/asm-util/9.1/asm-util-9.1.jar'. > Could not HEAD 'https://repo.maven.apache.org/maven2/org/ow2/asm/asm-util/9.1/asm-util-9.1.jar'. > repo.maven.apache.org Could not download asm-9.1.jar (org.ow2.asm:asm:9.1) > Could not get resource 'https://repo.maven.apache.org/maven2/org/ow2/asm/asm/9.1/asm-9.1.jar'. > Could not HEAD 'https://repo.maven.apache.org/maven2/org/ow2/asm/asm/9.1/asm-9.1.jar'. > repo.maven.apache.org Could not download bcpkix-jdk15on-1.67.jar (org.bouncycastle:bcpkix-jdk15on:1.67) > Could not get resource 'https://repo.maven.apache.org/maven2/org/bouncycastle/bcpkix-jdk15on/1.67/bcpkix-jdk15on-1.67.jar'. > Could not HEAD 'https://repo.maven.apache.org/maven2/org/bouncycastle/bcpkix-jdk15on/1.67/bcpkix-jdk15on-1.67.jar'. > repo.maven.apache.org Could not download jaxb-runtime-2.3.2.jar (org.glassfish.jaxb:jaxb-runtime:2.3.2) > Could not get resource 'https://repo.maven.apache.org/maven2/org/glassfish/jaxb/jaxb-runtime/2.3.2/jaxb-runtime-2.3.2.jar'. > Could not HEAD 'https://repo.maven.apache.org/maven2/org/glassfish/jaxb/jaxb-runtime/2.3.2/jaxb-runtime-2.3.2.jar'. > repo.maven.apache.org Could not download jopt-simple-4.9.jar (net.sf.jopt-simple:jopt-simple:4.9) > Could not get resource 'https://repo.maven.apache.org/maven2/net/sf/jopt-simple/jopt-simple/4.9/jopt-simple-4.9.jar'. > Could not HEAD 'https://repo.maven.apache.org/maven2/net/sf/jopt-simple/jopt-simple/4.9/jopt-simple-4.9.jar'. > repo.maven.apache.org Could not download javapoet-1.10.0.jar (com.squareup:javapoet:1.10.0) > Could not get resource 'https://repo.maven.apache.org/maven2/com/squareup/javapoet/1.10.0/javapoet-1.10.0.jar'. > Could not HEAD 'https://repo.maven.apache.org/maven2/com/squareup/javapoet/1.10.0/javapoet-1.10.0.jar'. > repo.maven.apache.org: Name or service not known Could not download grpc-protobuf-1.39.0.jar (io.grpc:grpc-protobuf:1.39.0) > Could not get resource 'https://repo.maven.apache.org/maven2/io/grpc/grpc-protobuf/1.39.0/grpc-protobuf-1.39.0.jar'. > Could not HEAD 'https://repo.maven.apache.org/maven2/io/grpc/grpc-protobuf/1.39.0/grpc-protobuf-1.39.0.jar'. > repo.maven.apache.org Could not download tink-1.3.0-rc2.jar (com.google.crypto.tink:tink:1.3.0-rc2) > Could not get resource 'https://repo.maven.apache.org/maven2/com/google/crypto/tink/tink/1.3.0-rc2/tink-1.3.0-rc2.jar'. > Could not HEAD 'https://repo.maven.apache.org/maven2/com/google/crypto/tink/tink/1.3.0-rc2/tink-1.3.0-rc2.jar'. > repo.maven.apache.org Could not download proto-google-common-protos-2.0.1.jar (com.google.api.grpc:proto-google-common-protos:2.0.1) > Could not get resource 'https://repo.maven.apache.org/maven2/com/google/api/grpc/proto-google-common-protos/2.0.1/proto-google-common-protos-2.0.1.jar'. > Could not HEAD 'https://repo.maven.apache.org/maven2/com/google/api/grpc/proto-google-common-protos/2.0.1/proto-google-common-protos-2.0.1.jar'. > repo.maven.apache.org Could not download protobuf-java-3.17.2.jar (com.google.protobuf:protobuf-java:3.17.2) > Could not get resource 'https://repo.maven.apache.org/maven2/com/google/protobuf/protobuf-java/3.17.2/protobuf-java-3.17.2.jar'. > Could not HEAD 'https://repo.maven.apache.org/maven2/com/google/protobuf/protobuf-java/3.17.2/protobuf-java-3.17.2.jar'. > repo.maven.apache.org Could not download grpc-netty-1.39.0.jar (io.grpc:grpc-netty:1.39.0) > Could not get resource 'https://repo.maven.apache.org/maven2/io/grpc/grpc-netty/1.39.0/grpc-netty-1.39.0.jar'. > Could not HEAD 'https://repo.maven.apache.org/maven2/io/grpc/grpc-netty/1.39.0/grpc-netty-1.39.0.jar'. > repo.maven.apache.org Could not download grpc-core-1.39.0.jar (io.grpc:grpc-core:1.39.0) > Could not get resource 'https://repo.maven.apache.org/maven2/io/grpc/grpc-core/1.39.0/grpc-core-1.39.0.jar'. > Could not HEAD 'https://repo.maven.apache.org/maven2/io/grpc/grpc-core/1.39.0/grpc-core-1.39.0.jar'. > repo.maven.apache.org Could not download kotlin-tooling-metadata-1.7.10.jar (org.jetbrains.kotlin:kotlin-tooling-metadata:1.7.10) > Could not get resource 'https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-tooling-metadata/1.7.10/kotlin-tooling-metadata-1.7.10.jar'. > Could not HEAD 'https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-tooling-metadata/1.7.10/kotlin-tooling-metadata-1.7.10.jar'. > repo.maven.apache.org Could not download grpc-stub-1.39.0.jar (io.grpc:grpc-stub:1.39.0) > Could not get resource 'https://repo.maven.apache.org/maven2/io/grpc/grpc-stub/1.39.0/grpc-stub-1.39.0.jar'. > Could not HEAD 'https://repo.maven.apache.org/maven2/io/grpc/grpc-stub/1.39.0/grpc-stub-1.39.0.jar'. > repo.maven.apache.org
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.
BUILD FAILED in 1s Retrying Gradle Build: #1, wait time: 100ms [!] Gradle threw an error while downloading artifacts from the network. Running Gradle task 'assembleDebug'...
Upvotes: 0
Views: 248
Reputation: 148
Solved. I commented out mavenCentral() from buildscript and allprojects. and added mavel url like this:
repositories {
google()
// mavenCentral()
maven {
url 'https://jcenter.bintray.com' // Use JCenter repository
}
}
allprojects {
repositories {
google()
maven {
url 'https://jcenter.bintray.com' // Use JCenter repository
}
// mavenCentral()
}
}
Upvotes: 0