Unable to find method 'org.gradle.api.tasks.TaskInputs.file

发布于 2022-09-12 00:38:52 字数 1387 浏览 25 评论 0

问题描述

我在安装好Android Studio之后,使用Android Studio打开项目,在同步项目的时候发生了以下错误:

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.

问题出现的平台版本及自己尝试过哪些方法

运行环境

运行平台:Windows 10
JAVA JDK版本:javac 1.8.0_231
Android Studio版本:3.5.0.0
硬件平台:AMD R5
虚拟化平台:Hyper-v
Gradle版本:5.4.1

尝试过以下方法

1.升级gradle版本 > 6.0.1
2.降级gradle版本 > 4.1
3.手动指定gradle版本:
image.png

相关代码

// 请把代码文本粘贴到下方(请勿用图片代替代码)

distributionPath\=wrapper/dists  
zipStoreBase\=GRADLE\_USER\_HOME  
zipStorePath\=wrapper/dists  
distributionUrl\=https\\://services.gradle.org/distributions/gradle-5.4.1-all.zip

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

白日梦 2022-09-19 00:38:52

最好的方式是,用命令行执行编译任务,比如 macOS 下,进入到项目里执行:

./gradlew clean assembleDebug

然后再把日志贴出来

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文