前言
升级Android Studio to 3.0 canary 1版本后,之前一个正常的Project,一直报错,报错内容如下
代码语言:javascript复制Error:Failed to complete Gradle execution.
Cause:
The version of Gradle you are using (3.3) does not support the forTasks() method on BuildActionExecuter. Support for this is available in Gradle 3.5 and all later versions.
这可把我坑苦了,手动下载Gradle,各种Clean,完全没有效果,坑爹的度娘也没给出好办法
解决
没办法,访问国外网站找谷歌爸爸看看,在 Stack Overflow上找到相同问题,Gradle version 3.3 does not support forTask() method on BuildActionExecuter,方法:
将 gradle-wrapper.propertie中
代码语言:javascript复制distributionUrl=https://services.gradle.org/distributions/gradle-3.3-all.zip
改为
复制代码 代码如下:
distributionUrl=https://services.gradle.org/distributions/gradle-4.0-milestone-1-all.zip
clean一遍,大功告成,编译之后,会变成
代码语言:javascript复制distributionUrl=https://services.gradle.org/distributions/gradle-3.5-all.zip
错误搞定,目前还没搞懂为什么会出现这个错误
以上就是本文的全部内容,希望对大家的学习有所帮助。