Reputation: 89
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:
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 }
Upvotes: 4
Views: 33239
Reputation: 320
Try deleting the folder gradle-2.4-all in ~/.gradle/wrapper/dists
Upvotes: 0
Reputation: 458
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
Upvotes: 7
Reputation: 497
Java versions > 9 and Gradle versions >= 5.0.0 has some code breaking changes. Here is to go around them using Eclipse. It should be similar in AndroidStudio.
This is working for me and I am using LibGDX with Java 11 and Gradle 5.2.1 on Windows 10 while running Eclipse 2018-12.
Upvotes: 0
Reputation: 1182
For me I think it is permission issue. From Eclipse I have also faced the same issue. On my gradle installation path (i.e. /opt/gradle) I have make it chmod as 777. So that other tool can access the same. Run the following 2 commands -
cd /opt
sudo chmod 777 -R gradle
Upvotes: 1
Reputation: 19351
Please, change
distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip
with
distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip
Then change
classpath 'com.android.tools.build:gradle:1.5.1'
with
classpath 'com.android.tools.build:gradle:2.0.0-alpha3'
It should work.
Upvotes: 2