Gradle version 3.3 does not support forTask() method on BuildActionExecuter
I've just had the same issue. Fixed it by changing Gradle distributionUrl in "gradle-wrapper.properties".
Here is what I have configured:
#Wed Mar 22 16:13:58 BRT 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
for more details
Offical video to help migaration https://www.youtube.com/watch?v=oBsbI8ICYKg
see also comment below from @TmTron
Change in the file "gradle-wrapper.properties".
Put this line and Sync Project-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
This will work. For Check latest version services.gradle.org/distributions
After changed, Sync Project, Clean and Rebuild project once from Build menu.
This happened when trying to build debug apk.
SOLUTION: Update Gradle version to 3.5
Navigate to File -> Project Structure -> Project -> Gradle Version = 3.5
This works for Android Studio 3.0
Please follow the below steps:
- Open your project in android studio
- In Android menu, open gradle-wrapper.properties
- Change the distribution url line with the below line
distributionUrl=https://services.gradle.org/distributions/gradle-4.1-all.zip
- Thats it. Build your project now.
Screenshot is attached for more understanding.