前言
升级Android Studio to 3.0 canary 1版本后,之前一个正常的Project,一直报错,报错内容如下
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](https://stackoverflow.com/questions/44206433/gradle-version-3-3-does-not-support-fortask-method-on-buildactionexecuter)](https://stackoverflow.com/questions/44206433/gradle-version-3-3-does-not-support-fortask-method-on-buildactionexecuter#),方法:
将 **gradle-wrapper.propertie**中
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一遍,大功告成,编译之后,会变成
distributionUrl=https://services.gradle.org/distributions/gradle-3.5-all.zip```
错误搞定,目前还没搞懂为什么会出现这个错误