Hello,
When I try to run a ./gradlew command on my project (Android Studio build seems to work), I keep getting the following error:
A problem occurred configuring project ':library'.
Could not resolve all dependencies for configuration ':library:classpath'.
Could not find com.android.tools.build:gradle:2.3.3.
Searched in the following locations:
https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.3.3/gradle-2.3.3.pom
https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.3.3/gradle-2.3.3.jar
Required by:
project :Teams.Core > com.jakewharton:butterknife-gradle-plugin:8.8.1
My project level build.gradle looks like:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.0.0'
}
}
allprojects {
repositories {
jcenter()
mavenCentral()
mavenLocal()
maven { url "https://maven.google.com" }
flatDir {
dirs 'libs'
}
}
}
Let me know if there is anything else useful to provide.
The error message indicates only Maven Central is being searched. You need jcenter() in your buildscript repositories which, despite your snippet, Gradle does not think is the case. It should probably be in the root build.gradle
Facing same problem. Any solution?
JakeWharton's answer worked for me.
@bschnack can you explane how to do it?
@realarmin Sorry I don't remember exactly what I did, but if you send your build.gradle I can try to help
Most helpful comment
The error message indicates only Maven Central is being searched. You need
jcenter()in your buildscript repositories which, despite your snippet, Gradle does not think is the case. It should probably be in the rootbuild.gradle