0

I am trying to run a Gradle but I get the following error:

*Gradle version 2.1 is required. Current version is 2.6.

Please fix the project's Gradle settings.
Fix Gradle wrapper and re-import project
Open Gradle wrapper properties
Gradle settings*

When I click Fix Gradle wrapper and re-import project, I get the following error:

Support for builds using Gradle versions older than 2.6 was removed in tooling API version 5.0. You are currently using Gradle version 2.1. You should upgrade your Gradle build to use Gradle 2.6 or later.

Possible solution:
 - Upgrade Gradle wrapper to 2.6 version and re-import the project

Either way, I get an error. I am new to Gradle and hugely confused. Much appreciated if someone could shed some light.

ctt23
  • 11
  • 3
  • Your gradle needs an update: Check it out: https://stackoverflow.com/questions/17727645/how-to-update-gradle-in-android-studio – tdmsoares Jul 11 '20 at 23:25
  • 3
    Does this answer your question? [How to update gradle in android studio?](https://stackoverflow.com/questions/17727645/how-to-update-gradle-in-android-studio) – tdmsoares Jul 11 '20 at 23:31

1 Answers1

0

Use gradle-wrapper.properties

distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip

And this configuration for app Level build.gradle

android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
    applicationId "com.example.cchat"
    minSdkVersion 22
    targetSdkVersion 29
    versionCode 5
    versionName "1.1"
    multiDexEnabled true
}

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

}
Lokesh Deshmukh
  • 728
  • 5
  • 13