简体   繁体   English

Android - 无法解析 org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10

[英]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.gradlerepositories括号中将其替换为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.

相关问题 没有 org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.21 的缓存版本可用于离线模式错误 - No cached version of org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.21 available for offline mode Error 错误:无法下载 kotlin-gradle-plugin.jar (org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.50):没有可离线使用的缓存版本 - Error: Could not download kotlin-gradle-plugin.jar (org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.50): No cached version available for offline Gradle 构建失败:找不到 org.jetbrains.kotlin 即使我没有使用 Kotlin - Gradle build failed : could not find org.jetbrains.kotlin even if I haven't used Kotlin 更新到Android Studio 3.1后,我遇到此错误:找不到org.jetbrains.kotlin:kotlin-stdlib-jre8:1.2.0 - After update to Android Studio 3.1 I'm facing this error: Could not find org.jetbrains.kotlin:kotlin-stdlib-jre8:1.2.0 找不到 arguments [org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.50] 的方法 implementation() - Could not find method implementation() for arguments [org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.50] 错误:找不到org.jetbrains.kotlin:kotlin-stdlib-jdk8 - ERROR: Could not find org.jetbrains.kotlin:kotlin-stdlib-jdk8 生命周期配置未涵盖插件执行:org.jetbrains.kotlin:kotlin-maven-plugin:1.1.51:test-compile - Plugin execution not covered by lifecycle configuration: org.jetbrains.kotlin:kotlin-maven-plugin:1.1.51:test-compile Gradle sync失败:无法加载类'org.jetbrains.kotlin.gradle.KotlinGradleModelImpl' - Gradle sync failed: Could not load class 'org.jetbrains.kotlin.gradle.KotlinGradleModelImpl' 错误:Kotlin:不支持的插件选项:org.jetbrains.kotlin.android:enabled=true - Error:Kotlin: Unsupported plugin option: org.jetbrains.kotlin.android:enabled=true 无法解析 org.jetbrains.kotlinx:kotlinx-gradle-serialization-plugin:0.5.1 - Could not resolve org.jetbrains.kotlinx:kotlinx-gradle-serialization-plugin:0.5.1
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM