Android Studio 解決 Error:Unable to find method 'org.gradle.api.tasks.TaskInputs.file(Ljava/lang/Ob...

Gradle編譯異常信息


Error:Unable to find method 'org.gradle.api.tasks.TaskInputs.file(Ljava/lang/Object;)Lorg/gradle/api/tasks/TaskInputFilePropertyBuilder;'.
Possible causes for this unexpected error include:<ul><li>Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
<a href="syncProject">Re-download dependencies and sync project (requires network)</a></li><li>The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
<a href="stopGradleDaemons">Stop Gradle build processes (requires restart)</a></li><li>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.</li></ul>In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.


原因:

由于使用的gradle編譯版本過低造成的.

解決方法:

  1. 查看Gradle的版本: Gradle地址.
  2. 修改在項目的根目錄下gradle/wrapper/目錄下的gradle-wrapper.properties文件,
    將原有的
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip

中gradle-2.14.1-all.zip改成步驟1中的所看到的合適的版本, 如下

distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-all.zip
最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容

  • 拍攝時間:2016.02.07 拍攝地點:廣西來賓市興賓區城廂鄉蓬萊洲 --------------我是靜靜的分割...
    我是阿富閱讀 275評論 0 0
  • 七年之后,陸離在這座城市租了個房子,留了下來。 Phil Penman/黑白紐約 在一座上個世紀的老樓房里,七樓,...
    老爺們兒南下閱讀 262評論 0 0
  • 《王陽明心學》(15) 生活中的心學之如何為成功“保鮮” 陸澄問:“主一之功,如讀書,則一心在讀書上,接客,...
    stone7519閱讀 502評論 0 4
  • 天下有道,卻走馬以糞。 天下無道,戎馬生于郊。 卻:止、退。糞:名詞動用,肥、養的意思。走:跑。戎馬:比喻精卵。郊...
    度樸閱讀 893評論 0 51