0

I want to compile my Android project in Android Studio 3.0.1 I have Gradle version 2.2 I receive an error while building the APK

Error:Failed to complete Gradle execution.

Cause:

The version of Gradle you are using (2.2) does not support the forTasks() method on BuildActionExecuter. Support for this is available in Gradle 3.5 and all later versions.

So I updated Gradle to 3.5 and 4.2 and i have another error :

Message :

Error:(1, 0) Gradle version 2.2 is required. Current version is 4.2.

How can i build my APK if i have to be in 2.2?

braX
  • 11,506
  • 5
  • 20
  • 33
YPL
  • 55
  • 7
  • Are you confused between gradle version and android gradle plugin version ? What is their values ? – Akhil Jan 17 '18 at 14:40

2 Answers2

0

First I would try cleaning and rebuilding the project, if that fails try some of the things mentioned here.

0

You should not confuse gradle plugin for android and gradle version itself.

Try setting 2.2 as gradle version and gradle plugin as 3.5. Should work. Hope it helps :)

abhiroxx
  • 116
  • 6