stackunderflow
stackunderflow

Reputation: 1774

Android - Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10

I have recently upgraded to 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

Could not resolve all artifacts for configuration ':classpath'. Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10. Required by: project : > Could not resolve 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'. > Could not GET '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

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.

Upvotes: 3

Views: 2748

Answers (1)

stackunderflow
stackunderflow

Reputation: 1774

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.

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.

(For Flutter user). Similar errors also occurred on Flutter's 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.

Upvotes: 3

Related Questions