[英]Android - Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10
I have recently upgraded to Flutter 3.0.我最近升级到 Flutter 3.0。 And later I encountered an issue after trying to run.
后来我在尝试运行后遇到了一个问题。 After it finished downloading Gradle 6.7 and on starting Gradle Daemon, I got this error
下载完 Gradle 6.7 并启动 Gradle 守护进程后,出现此错误
Could not resolve all artifacts for configuration ':classpath'.
无法解析配置“:classpath”的所有工件。 Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10.
无法解析 org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10。 Required by: project: > Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10.
要求:项目:> 无法解析 org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10。 > Could not get resource 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-gradle-plugin/1.6.10/kotlin-gradle-plugin-1.6.10.pom'.
> 无法获取资源“https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-gradle-plugin/1.6.10/kotlin-gradle-plugin-1.6.10.pom”。 > Could not GET 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-gradle-plugin/1.6.10/kotlin-gradle-plugin-1.6.10.pom'.
> 无法获取“https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-gradle-plugin/1.6.10/kotlin-gradle-plugin-1.6.10.pom”。 > Connect to jcenter.bintray.com:443 [jcenter.bintray.com/34.95.74.180] failed: connect timed out
> 连接到 jcenter.bintray.com:443 [jcenter.bintray.com/34.95.74.180] 失败:连接超时
And as the way Flutter handles the error, I stuck in loop with it redownloading the gradle zip file on and on for reason I don't know and resulting the same error endlessly.由于 Flutter 处理错误的方式,我陷入循环,重新下载 gradle zip 文件,出于我不知道的原因,并无休止地导致相同的错误。
After followed @curioushikhov's answer by commented out jcenter()
and replace it with mavenCentral()
in android/build.gradle
's repositories
bracket, the error is gone.在通过注释掉
jcenter()
并在android/build.gradle
的repositories
括号中将其替换为mavenCentral()
来遵循@curioushikhov 的回答后,错误消失了。
Turns out the error is caused by connection timeout.原来错误是由连接超时引起的。 I blame the server since my connection was fine.
我责怪服务器,因为我的连接很好。 More similar errors occur after.
之后会出现更多类似的错误。 I have to repeatedly run
gradlew clean
to completely get pass through it all.我必须反复运行
gradlew clean
才能完全通过这一切。
(For Flutter user). (对于 Flutter 用户)。 Similar errors also occurred on Flutter's app build.
Flutter 的 app build 也出现了类似的错误。 The problem with Flutter is once it occurs, it simply removes, redownloads and run gradle from begin repeatedly, cause it to redownload everything to resolve the dependencies.
Flutter 的问题是一旦出现,它只是简单地删除、重新下载并从头开始重复运行 gradle,导致它重新下载所有内容以解决依赖关系。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.