Reputation: 21
I'm new to Android-Studio and I'm trying to get an "old" app to run again. As soon as I synch Project with Gradle files it shows me an Errormessage:
Caused by: org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find com.android.tools.build:gradle:4.0.0.
I've tryed to update the Gradle plugin but im not sure if I did Everythin correct.
build.gradle:
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
gradle-wrapper.properties:
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl = https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
I've also added google() and mavenCentral() to the repositories, but that didn't help.
Upvotes: 1
Views: 3679
Reputation: 776
I had the same error and in my case the error was because Studio was being blocked by Windows 10 firewall. Check if Android Studio is permitted to communicate through the Windows Defender firewall else you will have to add studio64.exe to the list of 'Apps allowed to communicate through Windows Defender Firewall'. Please note this is one of the reasons you get the error and my error was resolved with the above solution.
Upvotes: 0
Reputation: 1737
Try at least version 6.2 or even better 6.5 (newest):
distributionUrl = https\://services.gradle.org/distributions/gradle-6.5-all.zip
Also try adding these repos to buildscript and allprojects repository:
mavenCentral()
google()
jcenter()
Upvotes: 1