解决ERROR: Unable to find method ‘org.gradle.api.tasks.TaskInputs.file(Ljava/lang/Object;)问题

ERROR: Unable to find method 'org.gradle.api.tasks.TaskInputs.file(Ljava/lang/Object;)Lorg/gradle/api/tasks/TaskInputs;

Recently purchased Android, this problem occurs when opening an old project for compilation.
insert image description here

solve the crime

One: Check the gradle plug-in version number of dependencies in build.gradle (not build.gradle under app).
Two: Download the corresponding Gradle package according to the gradle version number. Check the corresponding relationship between the gradle plug-in version number and the gradle version number.
Three : Download the corresponding Gradle version
Four: Set up in File | Settings | Build, Execution, Deployment | Gradle
Five: Recompile and it will be successful

insert image description here
insert image description here
insert image description here
insert image description here

You can also check out other solutions: https://www.freesion.com/article/66381191402/

Guess you like

Origin blog.csdn.net/weixin_51966599/article/details/126745497