Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not execute build using gradle distribution 'http://services.gradle.org/distributions/gradle-1.9-all.zip'

Tags:

android

gradle

I'm new to android development and I've downloaded Android SDK 4.2 and receiving the error:

Could not execute build using Gradle distribution 'http://services.gradle.org     /distributions/gradle-1.9-all.zip'. from the event log

I have tried many of the solutions here for similar error messages:

File - Invalidate Caches/restart - Invalidate and Restart. Then shutting down AS and renaming the .gradle folder in c/users/myname to old.gradle and restarting.

renaming the version number in build.gradle com.android.tools.build:gradle:0.7.+' to 0.8.+

renaming version in gradle-wrapper.properties services.gradle.org/distributions/gradle-1.9-all.zip to 1.10

uninstalling AS twice.

Some of the solutions I simple don't understand and for those that I do understand it seems I've tried them all.

I read to try another version of gradle 1.9, but don't where to begin. Are there versions like 1.9.1, 1.9.2..etc?

Any help?

build.gradle:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        mavenCentral()
     }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.7.+'
    }
}

 allprojects {
    repositories {
        mavenCentral()
    }
}

gradle-wrapper.properties:

#Wed Apr 10 15:27:10 PDT 2013
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=http\://services.gradle.org/distributions/gradle-1.9-all.zip
like image 459
KFP Avatar asked Nov 10 '22 12:11

KFP


1 Answers

I had the same problem as described at the top while following a course on Udemy. I was able to run my project on Android, but not Desktop. After messing around a lot, here is the solution that worked for me (n.b. I am a noob, so apologies for the simplicity of my answer:

with Project view (towards upper left, may be set to "Android":

go to gradle>wrapper>gradle-wrapper.properties and change the gradle distribution to "gradle-2.10-all.zip

then go to build.gradle and change "dependencies{classpath..." to "'com.android.tools.build:gradle:2.1.2'"

if you continue to get errors, you may need to return to the build.gradle and delete:

    jcenter()
    google()

near the top. Finally, ensure you are using the correct path for your assets by going to:

Launcher Options(where you select Android or Desktop deployment)>Edit Configurations

under working directory, set the path to android>assets

Hope this works for you

like image 142
Douglas Belton Avatar answered Nov 14 '22 22:11

Douglas Belton