Android Studio 1.0RC4 Gradle 构建错误 [英] Android Studio 1.0RC4 Gradle build error

查看:19
本文介绍了Android Studio 1.0RC4 Gradle 构建错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚下载了 Android Studio 1.0RC4,我无法构建任何项目,即使是新创建的项目.

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

我得到的错误是:

错误:无法使用 Gradle 分发版运行构建操作 'https://services.gradle.org/distributions/gradle-2.2.1-all.zip'.

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

我能够从浏览器下载 zip,但它在 AS 上不起作用.这是我的 build.gradle 文件:

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()
    }
}

模块构建文件:

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

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

我尝试运行 graddle - 从 cmd 构建,但出现此错误:

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

总时间:3.093 秒

Total time: 3.093 secs

JDK:1.8.0_05

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.

推荐答案

我终于搞定了,伙计们

我必须删除 'C:\Users\Username\' 中的 .gradle 文件夹,然后我以管理员权限打开 AS它复活了!

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!

谢谢大家.

这篇关于Android Studio 1.0RC4 Gradle 构建错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆