我正在尝试将 gradle 从 1.3.1 更新到 3.5,因为我的一些依赖项需要 3.3 或更高版本。
我见过类似的问题,但没有一个有帮助。
build.gradle :
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5'
}
}
gradle-wrapper.properties :
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-all.zip
当我尝试做任何事情(构建,清理等)时,我仍然得到这个:
Building and installing the app on the device (cd android && ./gradlew installDebug...
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'chat'.
> Could not resolve all dependencies for configuration ':classpath'.
> Could not find com.android.tools.build:gradle:3.5.
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/build/gradle/3.5/gradle-3.5.pom
https://jcenter.bintray.com/com/android/tools/build/gradle/3.5/gradle-3.5.jar
Required by:
project :
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
最佳答案
要解决此问题,请检查您是否拥有 谷歌() repo 您的项目级别 build.gradle 文件。
buildscript {
repositories {
jcenter()
google() //HAVE YOU MISS IT?
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
}
}
allprojects {
repositories {
jcenter()
google() //HAVE YOU MISS IT?
}
}
关于android - 找不到 com.android.tools.build :gradle:3. 5,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43497280/