9

I just downloaded Android Studio 1.0RC4 and I can't build any project, even newly created ones.

The error I got is:

Error:Could not run build action using Gradle distribution 'https://services.gradle.org/distributions/gradle-2.2.1-all.zip'.

I was able to download the zip from the browser but it's not working on AS. This is my build.gradle file:

// 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.0.0-rc1'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

Module build file:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 19
    buildToolsVersion "19.1.0"

    defaultConfig {
        applicationId "simple.com.car10"
        minSdkVersion 14
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
}

Graddle-wrapper.properties

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip

I Tried to run graddle - build from cmd, and I got this error:

FAILURE: Build failed with an exception.

* What went wrong:
Build file 'C:\Users\Giovanni\uild' does not exist.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.

BUILD FAILED

Total time: 3.093 secs

JDK: 1.8.0_05

When I hit try again nothing happens, I already tried uninstalling everything and installing again but it didn't work.

Any ideas guys? Thanks.

Moondustt
  • 864
  • 1
  • 11
  • 30

3 Answers3

23

I finally got it working guys

I had to delete the .gradle folder in 'C:\Users\Username\' and then I opened AS with admin rights and it came back to life!

Thanks everyone.

Moondustt
  • 864
  • 1
  • 11
  • 30
  • 1
    For the *NIX user, remove the directory under $HOME/.gradle, then restart Android studio. – alijandro Apr 21 '15 at 11:05
  • If you have x64 bit Intelli J then you must have x64 bit java with JAVA_HOME set to it and a _JAVA_OPTIONS -Djava.net.preferIPv4Stack=true set for some reason it has problem with ipv6. sucks – AZ_ May 06 '15 at 07:08
  • It's enough removing the caches folder inside the .gradle one and restarting Android Studio with admin rights. Anyway, thanks :) – andrea.rinaldi Nov 11 '15 at 11:11
  • Same error on Mac Yosemite. Have deleted everything in site - reinstalled multiple times. Always get: Consult IDE log for more details (Help | Show Log) The log says: 2016-04-11 18:40:45,569 [ 13180] INFO - ls.idea.gradle.GradleSyncState - Sync with Gradle for project 'My Application' failed: Could not create an instance of Tooling API implementation using the specified Gradle installation '/Applications/Android Studio.app/Contents/gradle/gradle-2.10'. – pcomitz Apr 11 '16 at 22:48
2

you can probably drop the RC-1 in your build.gradle:

classpath 'com.android.tools.build:gradle:1.0.0'

Here's a checklist of things that have changed recently

http://tools.android.com/tech-docs/new-build-system/migrating-to-1-0-0

Tyson Miller
  • 201
  • 1
  • 2
0

For 64 bit Windows 7, I had to download jdk7 64bit in addition to deleting the .gradle and starting Android studio as an admin. I had also set JAVA_HOME to 64bit JDK and set JAVA_OPTIONS to -Djava.net.preferIPv4Stack=true

ngrashia
  • 9,869
  • 5
  • 43
  • 58
RahulB
  • 1