Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle version 3.3 does not support forTask() method on BuildActionExecuter

I just updated my Android Studio to 3.0 canary 1. Now I am working on my existing project on Android Studio 3.0 canary 1. By default gradle:3.0.0-alpha1 is set in my project: gradle_file. So I changed my gradle version to 2.2.3 and now I'm getting this error:

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.

I attached my gradle file here

// Top-level build file where you can add configuration options common to all sub-projects/modules.  buildscript {     repositories {         jcenter()     }     dependencies {         classpath 'com.android.tools.build:gradle:2.2.3'         // NOTE: Do not place your application dependencies here; they belong         // in the individual module build.gradle files     } }  allprojects {     repositories {         jcenter()     } }  task clean(type: Delete) {     delete rootProject.buildDir } 
like image 519
Ajay Jayendran Avatar asked May 26 '17 16:05

Ajay Jayendran


People also ask

Why is the fortasks () method on buildactionexecuter not working in Gradle?

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.

What does this Gradle error message mean?

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.

What is the minimum supported Gradle version for Android Studio?

android - Gradle error: Minimum supported Gradle version is 3.3. Current version is 3.2 - Stack Overflow Gradle error: Minimum supported Gradle version is 3.3. Current version is 3.2 When I today update Android Studio it write: Minimum supported Gradle version is 3.3. Current version is 3.2 how can I solve this problem?

How do I update Android Gradle plugin to the latest version?

When you update Android Studio, you may receive a prompt to also update Gradle to the latest available version. For example, Android Gradle Plugin version 3.1.0+ requires a minimal gradle version 4.4. You can be configured via Android Studio File -> Project Structure -> Project. See below:


2 Answers

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

like image 107
falico Avatar answered Oct 20 '22 21:10

falico


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.

like image 44
Kailas Bhakade Avatar answered Oct 20 '22 21:10

Kailas Bhakade