失败的Gradle同步

时间:2016-12-14 21:28:00

标签: android android-studio gradle

我在启动Android studio时遇到此错误:

Error:Unable to find method 'org.gradle.api.tasks.Sync.getInputs()Lorg/gradle/api/internal/TaskInputsInternal;'.
Possible causes for this unexpected error include:

Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)>Re-download dependencies and sync project (requires network)

The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.Stop Gradle build processes (requires restart)

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.

In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.

我正在使用 Android Studio Canary 2.3 ,这是我的gradle版本:

classpath 'com.android.tools.build:gradle:2.3.0-alpha3'

我尝试了建议的解决方案,但没有一个有效。有关如何解决的任何建议吗?

1 个答案:

答案 0 :(得分:12)

使用gradle --version检查您的gradle版本。 Gradle 2.14.1不再工作了。

我将其更新为3.2.1,这对我有用。

你可以从gradle.org获得最新的奖励。如果使用包装器,请在gradle-wrapper.properties中更改您的版本。