android - Gradle 同步失败

标签 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'

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

最佳答案

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

我将它更新到 3.2.1,这对我有用。

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

关于android - Gradle 同步失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41152475/

相关文章:

android - 如何在 Android 中创建自定义 PopupMenu

gradle - 如何使用android studio将复制任务运行到assets文件夹中

java - 如何随机化这组问题?

android - 使用 Android Studio 将 github 项目集成到我的应用程序中

java - 项目同步时发生 Gradle 错误 : Cause: invalid type code: 32

android - 前置摄像头无法扫描条形码

android - 即使我禁用了持久性,Firestore 仍在从缓存中检索文档

android - Android Gradle Min SDK版本更改导致错误

flutter - 第一个项目中任务 ':app:processDebugManifest'的配置出现问题

android - 使用 LinearLayout 将按钮底部对齐