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-wrapper.propertie中
distributionUrl=https\://services.gradle.org/distributions/gradle-3.1-all.zip
修改为
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
clean工程 rebuild