This question already has an answer here:
When I try to build may Android project from command line, I get following error messages:
A problem occurred configuring project ':mylib'. Could not resolve all files for configuration ':mylib:classpath'. Could not find com.android.tools.build:gradle:3.0.0. Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.pom
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.jar https://repo1.maven.org/maven2/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.pom
https://repo1.maven.org/maven2/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.jar Required by: project :mylib
And when I try to access for example the address "https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.pom" directly via browser, following is shown:
{
"errors" : [ {
"status" : 404,
"message" : "Could not find resource"
} ]
}
The root gradle file contains following code:
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
...
allprojects {
repositories {
jcenter()
google()
}
}
And the file gradle-wrapper.properties contains following values:
#Fri Oct 27 10:09:16 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
The same configuration works fine if I compile from Android Studio 3.0. But if I try to compile directly from the command line, I receive the error.
Could anybody help me?
My question is "./gradlew assembleDebug" appeared,Android studio build is successful。I solved it this way
or
I am not quite sure, but maybe you should try putting the repositories tag at the same level of the dependencies tag. So: