i am getting this error while trying to update the gradle recently.
build.gradle :
apply plugin: 'com.android.application'
buildscript {
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
}
}
gradle.wrapper.properties
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
i cant identify why the dependency line referencing to a external repo. Central Repository: com/android/tools/build/gradle. where there is no (3.1.0)such a folder is found.
error:
- What went wrong:
A problem occurred configuring root project ‘android’.
Could not resolve all dependencies for configuration ‘:classpath’.
Could not find com.android.tools.build:gradle:3.1.0.
Searched in the following locations:
https://repo1.maven.org/maven2/com/android/tools/build/gradle/3.1.0/gradle-3.1.0.pom
https://repo1.maven.org/maven2/com/android/tools/build/gradle/3.1.0/gradle-3.1.0.jar
https://jcenter.bintray.com/com/android/tools/build/gradle/3.1.0/gradle-3.1.0.pom
https://jcenter.bintray.com/com/android/tools/build/gradle/3.1.0/gradle-3.1.0.jar
Required by:
project :
issue arises while trying to build an .apk (‘cordova build android’) after below changes are made.
- In build.gradle file —> changed to classpath ‘com.android.tools.build:gradle:2.2.3’ to classpath ‘com.android.tools.build:gradle:3.1.0’
- In gradle.wrapper.properties file —> changed distributionUrl=https://services.gradle.org/distributions/gradle-3.3-all.zip to …/gradle-4.4-all.zip