Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle - Could not create an instance of Tooling API implementation

I'm trying to import a project from GitHub and build/run it on Android Studio. I am getting the following error:

"Error:Could not create an instance of Tooling API implementation using the specified Gradle distribution 'https://services.gradle.org/distributions/gradle-2.4-all.zip'."

I have tried the following:

  1. Invalidate Cache and Restart
  2. Changing the distributionURL in gradle-wrapper/properties to 2.5 etc.
  3. Deleting build.gradle and restarting

These are ideas I got from several other posts on stackoverflow so I cannot explain why I tried these. (I'm very fairly new to Android Studio).

My build.gradle file looks like this:

// 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:1.5.1'

        // 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 559
Maddy Avatar asked Dec 24 '22 10:12

Maddy


1 Answers

I was facing a similar issue, updating the Gradle version in distributionUrl solved it.

distributionUrl field is present under this directory:

project-root-directory/gradle/wrapper/gradle-wrapper.properties
like image 92
kulsin Avatar answered Dec 30 '22 13:12

kulsin