将gradle升级到v6.1.1无法找到方法

时间:2020-06-10 03:12:52

标签: android-studio gradle

Unable to find method 'org.gradle.api.tasks.TaskInputs.property(Ljava/lang/String;Ljava/lang/Object;)Lorg/gradle/api/tasks/TaskInputs;'.
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.

1 个答案:

答案 0 :(得分:3)

如果有任何细节有助于解决问题,请仔细阅读此处的文档,这很有用:

https://docs.gradle.org/current/userguide/upgrading_version_5.html#changes_6.0

我的问题原来与特定的第三方插件Greendao3GradlePlugin有关。

我也记录了失败的步骤,以便其他人可以避免不必要的步骤。

./gradlew build失败,错误:Failed to notify project evaluation listener.

解决步骤:

  1. 将JDK升级到版本9:无法解析。

  2. 下载并安装JDK 9:无法解决。

  3. 安装SDK 30.0:无法解决。

  4. 添加configurations.all { resolutionStrategy.capabilitiesResolution.all { selectHighestVersion() } }至build.gradle:无法解析。

  5. 禁用所有第三方插件:无法解析。

  6. 升级到kotlin-gradle-plugin:1.3.72:无法解决。

  7. ./gradlew --scan build显示的错误来自Greendao3GradlePlugin,表明这是项目特定的错误。解决方案是解决此特定问题。

向有此问题的其他人推荐:使用Gradle Build Scans深入研究您的构建以查找有问题的第三方插件。