Unable to find method ‘org.gradle.api.tasks.TaskInputs.property(Ljava/lang/String;Ljava/lang/Object;

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.

Regarding the above error, the main reason for my side is that the submitted code was suddenly interrupted.

After opening the project, I keep reporting the above error and cannot run, which means:

此意外错误的可能原因包括:
Gradle的依赖项缓存可能已损坏(有时在网络连接超时后发生)

I found the reason after rowing. The main reason was that there was a problem with the gradle plug-in after the power outage on my side. The solution;

method one:

My gradle plugin version is 3.4.2, and the corresponding warpper plugin address is

distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip

Just change 6.1.1 to the version corresponding to 3.4.2, that is, change to 5.1.1 and it will be as follows:

distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip

Method Two:

Delete the gradle version that reported the error and download it again from the gradle official website

Then just re-gradle

 

Thanks to the blogger for providing ideas: direct bloggers

Guess you like

Origin blog.csdn.net/xiayiye5/article/details/108881505