android-studio - 升级 gradle 到 v6.1.1 找不到方法
问题描述
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.
解决方案
阅读此处的文档很有用,以防任何细节有助于解决问题:
https://docs.gradle.org/current/userguide/upgrading_version_5.html#changes_6.0
我的问题原来与特定的第三方插件有关,Greendao3GradlePlugin
.
我也记录了我失败的步骤,以便其他人可以避免不必要的步骤。
./gradlew build
失败并出现错误:Failed to notify project evaluation listener.
解决步骤:
将 JDK 升级到版本 9:无法解决。
下载并安装JDK 9:无法解决。
安装 SDK 30.0:无法解决。
添加
configurations.all { resolutionStrategy.capabilitiesResolution.all { selectHighestVersion() } }
到 build.gradle:无法解决。禁用所有第三方插件:无法解决。
升级到
kotlin-gradle-plugin:1.3.72
:无法解决。./gradlew --scan build
显示错误来自Greendao3GradlePlugin
,表明这是一个特定于项目的错误。解决方案是解决这个特定问题。
给有此问题的其他人的建议:使用Gradle Build Scans深入了解您的构建以查找问题第三方插件。
推荐阅读
- javascript - 使用 node.js 应用程序和 express,如何在不立即运行的情况下将函数传递给 ejs 页面
- amazon-s3 - AWS sam 模板如何为 S3 事件添加多个规则?
- excel - 移动行范围时复制数据
- printing - 删除odoo报告中的打印按钮
- c++ - C++ 如何按值向函数“发送”临时值?
- gitlab - 从上游拉动时git拒绝
- javascript - sap.ui.table.Table addRow() 示例
- xslt - XSLT 转换 XML 到 CSV 访问具有相同名称的嵌套元素
- android - “从 PlaceSelectionListener 派生的匿名类”类必须声明为抽象或实现抽象方法
- selenium - 当我尝试使用自动化代码时,为什么字段集不能自动填充?