【发布时间】:2017-12-05 09:20:11
【问题描述】:
我尝试在these instructions之后将项目中的 gradle 版本更新为 4.1-milestone-1
我当前的 gradle-wrapper.properties 文件:
#Sat Jun 17 21:17:43 IDT 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=\
https\://services.gradle.org/distributions/gradle-4.1-milestone-1-all.zip
我当前的项目 build.gradle 文件 buildscript
buildscript {
ext.kotlin_version = '1.1.3'
apply from: 'dependencies.gradle'
repositories {
jcenter()
mavenCentral()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-alpha5'
....
}
....
}
尝试编译项目时出现此错误:
错误:(1, 0) 找不到方法 'com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V'。 此意外错误的可能原因包括:
在 Gradle 进程损坏的情况下,您可以 还可以尝试关闭 IDE,然后终止所有 Java 进程。
- Gradle 的 依赖项缓存可能已损坏(这有时会在网络连接后发生 连接超时。)重新下载依赖项 和同步项目(需要网络)
- Gradle 的状态 构建过程(守护进程)可能已损坏。停止所有 Gradle 守护进程可能 解决这个问题。停止 Gradle 构建 进程(需要重新启动)
- 您的项目可能正在使用 与其他插件不兼容的第三方插件 请求的项目或 Gradle 版本 项目。
我尝试清理项目
我尝试点击重新下载依赖项和同步项目,但我得到了 同样的错误。
我在我的主目录和我的 项目,但我得到了同样的错误。
我尝试杀死 java 进程和 android studio 但我得到了 同样的错误。
我尝试杀死所有 gradle 的守护进程,但我得到了同样的错误
【问题讨论】:
-
你已经尝试了一切,所以可能是第三个原因是问题
Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project. -
我怎样才能知道它是哪个插件?
标签: java android android-studio gradle android-gradle-plugin