摇篮项目刷新Android Studio中1.2.1.1失败 [英] Gradle project refresh failed in Android Studio 1.2.1.1

查看:337
本文介绍了摇篮项目刷新Android Studio中1.2.1.1失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建示例项目上全新安装了Android Studio版本1.2.1.1和我碰到这样的错误消息:

I created sample project on the fresh installation of the Android Studio v 1.2.1.1 and i faced with this error message:

Gradle project refresh failed in Android Studio 1.2.1.1 

见下图:

所以我试图找到对谷歌的任何解决方案,我检查

So i tried to find any solution on the Google and i checked

gradle.properties 文件

哪里是:

dependencies {
        classpath 'com.android.tools.build:gradle:1.2.2'

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

之后,我尝试更新使用SDK管理器的所有SDK库

After that i tried to update all SDK libraries using SDK manager

之后,我试图找到在设置的问题(见图片)

And after that i tried to find issue in settings (see image)

但没有成功的一切。因为在错误说明是什么我不知道有什么可以是错误的,并修复的东西。

But everything without success. Because in the error description is nothing i don't know what can be wrong and what to repair.

任何想法吗?

任何帮助非常感谢。

注意:
Compilaton用科尔多瓦(这是使用过摇篮)是没有问题,而且应用程序编译。

Note: Compilaton using Cordova (which is using Gradle too) is without problems and app is compiled.

推荐答案

对于任何人谁与此错误挣扎,这里是我的解决方案:

For anyone who is struggling with this error, here is my solution:

步骤1)点击Android的工作室(上栏) - >preferences - >建立,实施,部署 - >生成工具 - >摇篮

Step 1) Click in "Android Studio" (upper bar) -> "Preferences" -> "Build, Execution, Deployment" -> "Build Tools" -> "Gradle"

和选择使用本地gradle这个分配,找到路径的文件的摇篮
(例如:/应用/ Android的Studio.app/Contents/gradle/gradle-2.8)

And select "Use local gradle distribution" and find the path for your Gradle file (eg. /Applications/Android Studio.app/Contents/gradle/gradle-2.8)

第2步)单击文件(上栏) - >项目结构 - >模块部分中,选择应用程序。
然后,请确保您已经设置了编译器SDK版本和构建工具版本

Step 2) Click in "File" (upper bar) -> "Project Structure" -> Select "app" in the "Modules" section. Then, make sure you have set the Compiler SDK Version and Build Tools Version

第3步)打开您的项目 - >打开的build.gradle文件,然后删除以下行:

Step 3) Open your project -> Open "build.gradle" file and then remove the following lines:

android {
    compileSdkVersion XX
    buildToolsVersion 'XX.X.X'
}

第四步)点击同步工程与摇篮文件按钮。

Step 4) Click in "Sync Project with Gradle Files" button.

完整说明

这篇关于摇篮项目刷新Android Studio中1.2.1.1失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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