Android的工作室更新 - 错误:无法运行使用摇篮分布生成操作 [英] Android Studio update -Error:Could not run build action using Gradle distribution

查看:355
本文介绍了Android的工作室更新 - 错误:无法运行使用摇篮分布生成操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近更新的Andr​​oid工作室到最新版本,但随后而来的问题。

摇篮'MyApplication的项目刷新失败。
错误://服务:无法使用分配摇篮 HTTPS运行生成操作。 gradle.org/distributions/gradle-2.2.1-all.zip

在计算器

不过乱投医没有什么作品 - 在moment.Please好心劝告不能创造任何进口的新项目

 应用插件:'com.android.application  安卓{
    compileSdkVersion 21
    buildToolsVersion21.1.2     defaultConfig {
        的applicationIDcom.sclick.myapplication
        14的minSdkVersion
        targetSdkVersion 21
        版本code 1
        的versionName1.0
    }
    任务组装{}
    buildTypes {
        发布 {
            minifyEnabled假
            proguardFiles getDefaultProguardFile('proguard的-android.txt'),'proguard-rules.pro
        }
    }
}依赖{
    编译文件树(导演:'库',包括:['的* .jar'])
    编译com.android.support:appcompat-v7:21.0.3
}      **顶级Gradle.build **

//顶级构建文件,您可以添加通用于所有配置选项
           子项目/模块。

  buildscript {
        库{
            jcenter()
        }
        依赖{
            类路径'com.android.tools.build:gradle:1.0.0            //注意:不要在这里把你的应用程序依赖关系;他们属于
            //在单个模块的build.gradle文件
        }
    }
    allprojects {
        库{
            jcenter()
        }
    }

gradle-wrapper.properties

  #Wed 4月10日15点27分10秒PDT 2013
distributionBase = GRADLE_USER_HOME
distributionPath =包装/ dists中
zipStoreBase = GRADLE_USER_HOME
zipStorePath =包装/ dists中
distributionUrl = HTTPS \\://services.gradle.org/distributions/gradle-2.2.1-all.zip


解决方案

我有同样的问题。我已经尝试了很多东西,但没有工作,直到我尝试以下操作:


  1. 关闭AS。

  2. 删除文件夹中的 C:\\用户\\ .gradle \\包装\\ dists目录\\ gradle这个-2.2.1-所有(请务必将其删除所有)

  3. 开启AS以管理员身份。

  4. 尝试同步项目文件。

  5. 如果还没有工作到现在,重新启动计算机。重新运行AS。 (我是这样)。

希望它会工作。即使没有工作到现在,尝试打开其他一些项目,并重复上述步骤。有这个问题的步骤5,现已开放项目后。

I have recently updated android studio to the latest version,but then comes the problem.

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

Found this in StackOverflow

However trying everything nothing works - cannot create new project of import anything at the moment.Please kindly advice.

  apply plugin: 'com.android.application'  

  android {
    compileSdkVersion 21
    buildToolsVersion "21.1.2"

     defaultConfig {
        applicationId "com.sclick.myapplication"
        minSdkVersion 14
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
    }
    task assemble{}
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:21.0.3'
}

      **Top Level Gradle.build**

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

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


    allprojects {
        repositories {
            jcenter()
        }
    }

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=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip

解决方案

I had same issue. I have tried many things but nothing worked Until I try following:

  1. Close AS.
  2. Delete Folder in C:\Users\.gradle\wrapper\dists\gradle-2.2.1-all (Make sure to delete it all)
  3. Open AS as Administrator.
  4. Try to sync project files.
  5. If it has not worked till now, Restart your computer. re-run AS. (mine was like this).

Hopefully It will work. Even if it has not worked till now, try to open some other projects and repeat the procedure. After step 5, now open project which has this issue.

这篇关于Android的工作室更新 - 错误:无法运行使用摇篮分布生成操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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